diff --git a/.copier-answers.yml b/.copier-answers.yml index 6f781af2..60882e47 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 47b9a0d +_commit: 42d3de7 _src_path: gh:blakeNaccarato/copier-python actions_runner: ubuntu-latest active: true @@ -9,6 +9,6 @@ project_email: blake.naccarato@gmail.com project_name: boilerdata project_owner_github_username: blakeNaccarato project_owner_name: Blake Naccarato -project_version: 0.0.0 +project_version: 0.0.1 python_version: '3.11' year_of_project_creation: 2022 diff --git a/.env b/.env index b9eea82f..c26341a3 100644 --- a/.env +++ b/.env @@ -1,17 +1,5 @@ # Enable rich feedback and exceptions at the command line -PYTHONSTARTUP = pythonrc.py +PYTHONSTARTUP = .tools/scripts/pythonstartup.py PYDEVD_DISABLE_FILE_VALIDATION=1 -# default: Warn for all warnings, even `DeprecationWarning` -# pkg_resources: https://github.com/blakeNaccarato/copier-python/issues/319#issue-1609228740 -# Creating a LegacyVersion: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1454209165 -# pre_commit read_text and open_text: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1455177114 -# imp module and ABCs: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1455183241 -# dpath...pkg_resources: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1457219723 -# unclosed file...plumbum: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1458742412 -# ignore:is still running:subprocess:ResourceWarning:subprocess: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1493072447 -# ignore:BuiltinImporter.module_repr:DeprecationWarning:importlib._bootstrap: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1493542865 -# ignore:lib2to3: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1502112446 -# ignore:ImportDenier:ImportWarning: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1546359005 -# ignore:numpy.ndarray size changed:RuntimeWarning: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1546360423 -# ignore::DeprecationWarning:sphinx.util.images...sphinx_book_theme: https://github.com/blakeNaccarato/copier-python/issues/319#issuecomment-1591786172 -PYTHONWARNINGS = default,ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning,ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:pip._vendor.packaging.version,ignore:read_text is deprecated:DeprecationWarning:pre_commit.util,ignore:open_text is deprecated:DeprecationWarning:importlib.resources._legacy,ignore:the imp module is deprecated in favour of importlib:DeprecationWarning:googlecloudsdk.core.util.importing,ignore:Using or importing the ABCs:DeprecationWarning:jsonschema.compat,ignore:The dpath.util package is being deprecated.:DeprecationWarning:dvc.dependency.param,ignore:unclosed file:ResourceWarning:dvc.stage.cache,ignore:the imp module is deprecated:DeprecationWarning:ansiwrap.core,ignore:unclosed file:ResourceWarning:ansiwrap.core,ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning:jupyter_client.connect,ignore:the file is not specified with any extension:UserWarning:papermill.iorw,ignore:Passing unrecognized arguments to super:DeprecationWarning:traitlets.config.configurable,ignore:pkg_resources is deprecated as an API:DeprecationWarning,ignore:unclosed file:ResourceWarning:plumbum.commands.base,ignore:Passing unrecognized arguments to super:DeprecationWarning:ipywidgets.widgets.widget,ignore:`ipykernel.pylab.backend_inline` is deprecated:DeprecationWarning:ipykernel.pylab.backend_inline,ignore:subprocess:ResourceWarning:subprocess,ignore:BuiltinImporter.module_repr:DeprecationWarning:importlib._bootstrap,ignore:lib2to3 package is deprecated and may not be able to parse Python:PendingDeprecationWarning,ignore:lib2to3 package is deprecated and may not be able to parse Python:DeprecationWarning,ignore:ImportDenier:ImportWarning,ignore:numpy.ndarray size changed:RuntimeWarning,ignore::DeprecationWarning:sphinx.util.images,ignore::DeprecationWarning:myst_nb.sphinx_ext,ignore::DeprecationWarning:myst_parser.mdit_to_docutils.base,ignore::DeprecationWarning:optparse,ignore:Proactor event loop:RuntimeWarning:zmq._future,ignore::PendingDeprecationWarning:myst_nb.ext.execution_tables,ignore::PendingDeprecationWarning:sphinx_book_theme +# ! Don't edit below. `warning_filters.py` may trash any changes. +PYTHONWARNINGS=default,ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning,ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:pip._vendor.packaging.version,ignore:read_text is deprecated:DeprecationWarning:pre_commit.util,ignore:open_text is deprecated:DeprecationWarning:importlib.resources._legacy,ignore:the imp module is deprecated in favour of importlib:DeprecationWarning:googlecloudsdk.core.util.importing,ignore:Using or importing the ABCs:DeprecationWarning:jsonschema.compat,ignore:The dpath.util package is being deprecated.:DeprecationWarning:dvc.dependency.param,ignore:unclosed file:ResourceWarning:dvc.stage.cache,ignore:the imp module is deprecated:DeprecationWarning:ansiwrap.core,ignore:unclosed file:ResourceWarning:ansiwrap.core,ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning:jupyter_client.connect,ignore:the file is not specified with any extension:UserWarning:papermill.iorw,ignore:Passing unrecognized arguments to super:DeprecationWarning:traitlets.config.configurable,ignore:pkg_resources is deprecated as an API:DeprecationWarning,ignore:unclosed file:ResourceWarning:plumbum.commands.base,ignore:Passing unrecognized arguments to super:DeprecationWarning:ipywidgets.widgets.widget,ignore:`ipykernel.pylab.backend_inline` is deprecated:DeprecationWarning:ipykernel.pylab.backend_inline,ignore:subprocess:ResourceWarning:subprocess,ignore:BuiltinImporter.module_repr:DeprecationWarning:importlib._bootstrap,ignore:lib2to3 package is deprecated and may not be able to parse Python:PendingDeprecationWarning,ignore:lib2to3 package is deprecated and may not be able to parse Python:DeprecationWarning,ignore:ImportDenier:ImportWarning,ignore:numpy.ndarray size changed:RuntimeWarning,ignore::DeprecationWarning:sphinx.util.images,ignore::DeprecationWarning:myst_nb.sphinx_ext,ignore::DeprecationWarning:myst_parser.mdit_to_docutils.base,ignore::DeprecationWarning:optparse,ignore:Proactor event loop:RuntimeWarning:zmq._future,ignore::PendingDeprecationWarning:myst_nb.ext.execution_tables,ignore::PendingDeprecationWarning:sphinx_book_theme,ignore:Please use `binary_dilation`:DeprecationWarning:trackpy.uncertainty,ignore:Importing clear_output from IPython.core.display is deprecated:DeprecationWarning:trackpy.utils,ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning,ignore:unclosed file <_io.BufferedReader name:ResourceWarning,ignore:subpackages can technically be lazily loaded:RuntimeWarning diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21fe5a56..b4310d1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -126,6 +126,7 @@ repos: rev: "23.7.0" hooks: - id: "black" + - id: "black-jupyter" - repo: "https://github.com/charliermarsh/ruff-pre-commit" rev: "v0.0.282" hooks: @@ -166,7 +167,5 @@ repos: - repo: "https://github.com/nbQA-dev/nbQA" rev: "1.7.0" hooks: - - id: "nbqa-black" - additional_dependencies: ["black==23.7.0"] - id: "nbqa-ruff" additional_dependencies: ["ruff==0.0.282"] diff --git a/.tools/requirements/requirements_both.txt b/.tools/requirements/requirements_both.txt index 9f06568c..d306fcc7 100644 --- a/.tools/requirements/requirements_both.txt +++ b/.tools/requirements/requirements_both.txt @@ -11,10 +11,9 @@ copier==8.1.0 flit==3.9.0 # Type checking -pyright +pyright==1.1.321 # Pre-commit common requirements -black==23.7.0 ruff==0.0.282 # Testing diff --git a/.tools/requirements/requirements_dev.txt b/.tools/requirements/requirements_dev.txt index ddf4db14..a63ca9c0 100644 --- a/.tools/requirements/requirements_dev.txt +++ b/.tools/requirements/requirements_dev.txt @@ -24,6 +24,7 @@ rich==13.5.2 ipython==8.14.0 # Format +black[jupyter]==23.7.0 sourcery-cli==1.6.0 # Profiling diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9f5114d7..9eeba825 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -39,16 +39,6 @@ "tasks": [ // * -------------------------------------------------------------------------- * // // * Changes below should persist in significant template updates. - { - "label": "dvc: repro force downstream", - "dependsOrder": "sequence", - "dependsOn": ["dvc: synchronize params"], - "type": "process", - "command": "pwsh", - "args": ["-Command", "dvc repro --force --downstream ${input:stage}"], - "icon": { "id": "graph" }, - "problemMatcher": [] - }, { "label": "dvc: repro", "dependsOrder": "sequence", @@ -60,39 +50,26 @@ "problemMatcher": [] }, { - "label": "dvc: repro force all", + "label": "dvc: repro force downstream", "dependsOrder": "sequence", - "dependsOn": [ - "setup: Update project", - "dvc: synchronize params", - "dvc: freeze", - "git: Stage all files", - "pre-commit", - "git: Stage all files" - ], + "dependsOn": ["dvc: synchronize params"], "type": "process", "command": "pwsh", - "args": ["-Command", "dvc repro --force"], + "args": ["-Command", "dvc repro --force-downstream ${input:stage}"], "icon": { "id": "graph" }, "problemMatcher": [] }, { - "label": "dvc: repro all", + "label": "dvc: repro force", "dependsOrder": "sequence", - "dependsOn": [ - "setup: Update project", - "dvc: synchronize params", - "dvc: freeze", - "git: Stage all files", - "pre-commit", - "git: Stage all files" - ], + "dependsOn": ["dvc: synchronize params"], "type": "process", "command": "pwsh", - "args": ["-Command", "dvc repro"], + "args": ["-Command", "dvc repro --force ${input:stage}"], "icon": { "id": "graph" }, "problemMatcher": [] }, + { "label": "dvc: dag", "dependsOrder": "sequence", @@ -114,14 +91,6 @@ "icon": { "id": "graph" }, "problemMatcher": [] }, - { - "label": "dvc: freeze", - "type": "shell", - "options": { "shell": { "executable": "pwsh", "args": ["-Command"] } }, - "command": "pip freeze --requirement .tools/requirements/requirements.txt --local --exclude-editable > repro.txt", - "icon": { "id": "graph" }, - "problemMatcher": [] - }, // * -------------------------------------------------------------------------- * // // * WSL-SPECIFIC * // { diff --git a/CHANGELOG.md b/CHANGELOG.md index f2091eb9..a1adf93c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet +## [0.0.1] + +- Implement tests +- Refactor out logic for models containing just file paths and project paths +- Flatten the paths model parameters +- Decouple latest development dependency versions from lower bounds in `pyproject.toml` + ## [0.0.0] - Freeze requirements used for pipeline reproduction in `repro.txt` for this release -[Unreleased]: https://github.com/blakeNaccarato/boilerdata/compare/0.0.0...HEAD +[Unreleased]: https://github.com/blakeNaccarato/boilerdata/compare/0.0.1...HEAD +[0.0.1]: https://github.com/blakeNaccarato/boilerdata/releases/tag/0.0.1 [0.0.0]: https://github.com/blakeNaccarato/boilerdata/releases/tag/0.0.0 diff --git a/docs/conf.py b/docs/conf.py index e9fc3a19..03c295d5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,13 +2,13 @@ project = "" html_title = "boilerdata" -copyright = f"{date.today().year}, Blake Naccarato, Kwang Jin Kim" # noqa: A001 -version = "0.0.0" +copyright = f"{date.today().year}, Blake Naccarato" # noqa: A001 +version = "0.0.1" master_doc = "index" language = "en" exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] html_theme = "sphinx_book_theme" -extensions = ["myst_parser", "sphinx_design", "sphinxcontrib.mermaid"] +extensions = ["myst_parser", "sphinx_design"] # https://sphinx-book-theme.readthedocs.io/en/stable/reference.html#reference-of-theme-options html_theme_options = { "path_to_docs": "docs", diff --git a/dvc.lock b/dvc.lock index 6f236dc6..088cf2bd 100644 --- a/dvc.lock +++ b/dvc.lock @@ -51,8 +51,8 @@ stages: outs: - path: data/modelfun hash: md5 - md5: fe0656588888ce19d4b3cabeeb66aa27.dir - size: 60136 + md5: 0bca910877e3b8387ba1311ada4832c2.dir + size: 60067 nfiles: 1 runs: cmd: python -m boilerdata.stages.runs @@ -90,8 +90,8 @@ stages: nfiles: 1 - path: data/modelfun hash: md5 - md5: fe0656588888ce19d4b3cabeeb66aa27.dir - size: 60136 + md5: 0bca910877e3b8387ba1311ada4832c2.dir + size: 60067 nfiles: 1 - path: data/runs hash: md5 @@ -100,8 +100,8 @@ stages: nfiles: 1 - path: src/boilerdata/stages/pipeline.py hash: md5 - md5: 940d214f9890f82709e907b47aa6c98a - size: 8938 + md5: 71728116e120fb597e375e12e256f717 + size: 8905 - path: src/boilerdata/validation.py hash: md5 md5: 3bf12c7498eae3ab299f2776be0ce064 @@ -134,52 +134,52 @@ stages: outs: - path: data/results hash: md5 - md5: d46e3b9c9a88cd4d01a464cc03ddd912.dir - size: 235130 + md5: 8645a483c5bb8611bf3b865b487f96d5.dir + size: 235134 nfiles: 1 metrics: cmd: ploomber-engine src/boilerdata/stages/metrics.ipynb NUL deps: - path: data/results hash: md5 - md5: d46e3b9c9a88cd4d01a464cc03ddd912.dir - size: 235130 + md5: 8645a483c5bb8611bf3b865b487f96d5.dir + size: 235134 nfiles: 1 - path: src/boilerdata/stages/metrics.ipynb hash: md5 - md5: 6ebf997408248cb991c008ec61424193 - size: 7556 + md5: cdfac0be8e69ebd6b3f3373bac728212 + size: 7504 params: params.yaml: do_plot: true outs: - path: data/metrics/plots/error_T_s.png hash: md5 - md5: 770a235b7ffca10bc71d8fc5e5cfa7ca - size: 125605 + md5: a8c6ac008f83de621cdca414ff6f03f1 + size: 124366 - path: data/metrics/plots/error_h_a.png hash: md5 - md5: ae889a01f63fb2f2fcb47f7245607315 - size: 206579 + md5: 8835ee8054fd5ade3c53a80ca08a8bcd + size: 210439 - path: data/metrics/plots/error_q_s.png hash: md5 - md5: 68bc0e1b108f183129bbedb0cb416d69 - size: 175942 + md5: d875825eb2b305bbb50a42a45b9ea0a4 + size: 179555 - path: data/metrics/plots/new_fit_0.png hash: md5 md5: 5e6067f396efc35e7fd7ca22b484f108 size: 119322 - path: data/metrics/plots/new_fit_1.png hash: md5 - md5: e9698e1483bc90f56ed69fc4b5498fc0 - size: 113970 + md5: f1b24f6e955d6281d77e5b08186bf8b5 + size: 113613 - path: data/metrics/plots/new_fit_2.png hash: md5 - md5: af49877b1a50b9b89c7e73fcada72684 - size: 125344 + md5: a0aba8c7a4737288d0c96463c149390a + size: 145431 - path: data/metrics/tables/pipeline_metrics.json hash: md5 - md5: 1aa224e207ef9602b1fa51fe360d52c2 + md5: 78255ff52f10a50b73b656ce80f57305 size: 207 literature: cmd: python -m boilerdata.stages.literature @@ -191,13 +191,13 @@ stages: nfiles: 9 - path: src/boilerdata/models hash: md5 - md5: 83b50eb5fbb0d13e1346788de460fd62.dir - size: 31189 + md5: cceed6391a3abc02e8ce0952565ec8a3.dir + size: 31190 nfiles: 7 - path: src/boilerdata/stages/literature.py hash: md5 - md5: 827c5400c0cf0482df4ac5997864f454 - size: 3313 + md5: 4ccb001a11f740873988f6333f90976d + size: 3322 outs: - path: data/literature_results hash: md5 @@ -209,21 +209,17 @@ stages: deps: - path: .tools/requirements hash: md5 - md5: 837cdbaa59c3b9a5b1e17a8d34a0ed16.dir - size: 1893 - nfiles: 4 + md5: 71b80ef4e21a86f12ab66ab0003930ea.dir + size: 2459 + nfiles: 6 - path: config/axes.yaml hash: md5 md5: 5f95c2418c2d82618d10d711a50c0f2f size: 2320 - - path: requirements.txt - hash: md5 - md5: c3d5e7eee07c3c2eced5512b0a4bf7fa - size: 563 - path: src/boilerdata/models hash: md5 - md5: 83b50eb5fbb0d13e1346788de460fd62.dir - size: 31189 + md5: cceed6391a3abc02e8ce0952565ec8a3.dir + size: 31190 nfiles: 7 - path: src/boilerdata/stages/axes.py hash: md5 diff --git a/dvc_repro.ps1 b/dvc_repro.ps1 deleted file mode 100644 index 24293ac2..00000000 --- a/dvc_repro.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -<#.SYNOPSIS -Reproduce the exact results during this commit. -#> - -# Create the frozen virtual environment -$FROZEN_VENV = '.venv-frozen' -if ($Env:VIRTUAL_ENV) { 'deactivate' } -if (Test-Path $FROZEN_VENV) { Remove-Item -Recurse -Force $FROZEN_VENV } -$GLOBAL_PYTHON = 'py -3.10' -try { Invoke-Expression $("$GLOBAL_PYTHON --version") } -catch [System.Management.Automation.CommandNotFoundException] { - $GLOBAL_PYTHON = 'python3.10' -} -Invoke-Expression "$GLOBAL_PYTHON -m venv $FROZEN_VENV" - -# Activate environment -$VENV_ACTIVATE_WINDOWS = "$FROZEN_VENV/Scripts/activate" -$VENV_ACTIVATE_UNIX = "$FROZEN_VENV/bin/Activate.ps1" -if ( Test-Path $VENV_ACTIVATE_WINDOWS ) { . $VENV_ACTIVATE_WINDOWS } -elseif ( Test-Path $VENV_ACTIVATE_UNIX ) { . $VENV_ACTIVATE_UNIX } -else { - throw [System.Management.Automation.ItemNotFoundException] 'Could not find a virtual environment.' -} - -# Install the package and all frozen requirements -pip install --no-deps '.' -pip install --requirement 'repro.txt' - -# Reproduce the results using DVC -dvc repro diff --git a/frozen_requirements.txt b/frozen_requirements.txt deleted file mode 100644 index 24ce15ab..00000000 --- a/frozen_requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy diff --git a/pyproject.toml b/pyproject.toml index 8ea3f4be..3765ab42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "flit_core.buildapi" [project] name = "boilerdata" -version = "0.0.0" +version = "0.0.1" description = "Data processing pipeline for a nucleate pool boiling apparatus." readme = "README.md" license = { file = "LICENSE" } @@ -23,7 +23,7 @@ dependencies = [ "matplotlib>=3.7.2", "nbqa>=1.7.0", "pandas[hdf5,performance]>=2.0.2", - "pandas-stubs~=2.0.2", + "pandas-stubs>=2.0.2", "pandera>=0.16.1", "ploomber-engine>=0.0.30", "propshop>=0.1.1", @@ -64,6 +64,7 @@ ignore_undeclared = [ "graphviz", # .tools/requirements/requirements_docs.txt "originpro", # .tools/requirements/requirements_dev.txt "pytest", + "rich", # .tools/requirements/requirements_dev.txt ] [tool.ruff] diff --git a/tests/data/data/modelfun/model.dillpickle b/tests/data/data/modelfun/model.dillpickle index c82459d2..2d55c17b 100644 Binary files a/tests/data/data/modelfun/model.dillpickle and b/tests/data/data/modelfun/model.dillpickle differ