calkit-python 0.27.0__tar.gz → 0.27.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {calkit_python-0.27.0 → calkit_python-0.27.2}/PKG-INFO +1 -1
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/__init__.py +1 -1
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/main.py +13 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/notebooks.py +2 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/models/iteration.py +10 -1
- calkit_python-0.27.2/calkit/tests/cli/test_notebooks.py +47 -0
- calkit_python-0.27.2/calkit/tests/models/test_iteration.py +16 -0
- calkit_python-0.27.2/test/nb-subdir.ipynb +30 -0
- calkit_python-0.27.0/calkit/tests/cli/test_notebooks.py +0 -14
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.github/FUNDING.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.github/workflows/docs.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.github/workflows/format.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.github/workflows/publish-test.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.github/workflows/publish.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.github/workflows/test.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.gitignore +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.pre-commit-config.yaml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/.python-version +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/CITATION.cff +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/CONTRIBUTING.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/LICENSE +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/Makefile +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/README.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/__main__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/calc.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/check.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/check.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/cloud.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/config.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/core.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/describe.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/import_.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/list.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/new.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/office.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/overleaf.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cli/update.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/cloud.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/conda.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/config.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/core.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/datasets.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/docker.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/dvc.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/environments.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/git.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/github.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/gui.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/jupyter.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/magics.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/matlab.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/models/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/models/core.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/models/io.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/models/pipeline.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/notebooks.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/office.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/ops.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/pipeline.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/releases.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/server.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/core.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/article/paper.tex +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/core.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/jfm/jfm.bst +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/jfm/jfm.cls +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/jfm/lineno-FLM.sty +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/jfm/paper.tex +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/templates/latex/jfm/upmath.sty +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/cli/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/cli/test_check.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/cli/test_config.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/cli/test_list.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/cli/test_main.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/cli/test_new.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/models/__init__.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/models/test_pipeline.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_calc.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_check.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_conda.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_core.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_dvc.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_jupyter.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_magics.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_notebooks.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_pipeline.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/tests/test_templates.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/calkit/zenodo.py +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/CNAME +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/apps.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/calculations.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/calkit-yaml.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/cli-reference.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/cloud-integration.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/datasets.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/dependencies.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/environments.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/examples.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/help.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/img/c-to-the-k-white.svg +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/img/calkit-no-bg.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/img/connect-zenodo.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/img/jupyterlab-params.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/img/vscode-nb-params.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/index.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/installation.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/local-server.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/notebooks.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/overleaf.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/pipeline/index.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/pipeline/manual-steps.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/pipeline/running-and-logging.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/quickstart.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/references.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/releases.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/adding-latex-pub-docker.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/conda-envs.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/existing-project.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/first-project.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/building-codespace.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/codespaces-secrets-2.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/editor-split.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/go-to-linked-code.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/issue-from-selection.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/new-project.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/new-pub-2.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/new-token.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/paper.tex.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/project-home-3.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/push.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/stage.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/anakin-excel.jpg +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/chart-more-rows.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/create-project.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/elsevier-research-data-guidelines.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/excel-chart.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/excel-data.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/insert-link-to-file.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/needs-clone.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/new-stage.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/phd-comics-version-control.webp +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/pipeline-out-of-date.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/status-more-rows.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/uncommitted-changes.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/untracked-data.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/updated-publication.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/word-to-pdf-stage-2.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/workflow-page.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/clone.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/create-project.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/datasets-page.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/figure-on-website-updated.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/figure-on-website.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/new-token.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/reclone.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/status-after-import-dataset.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/run-proc.png +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/index.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/latex-codespaces.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/matlab.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/notebook-pipeline.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/office.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/openfoam.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/procedures.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/docs/version-control.md +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/mkdocs.yml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/pyproject.toml +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/scripts/install.ps1 +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/scripts/install.sh +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/test/pipeline.ipynb +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/test/test-log.log +0 -0
- {calkit_python-0.27.0 → calkit_python-0.27.2}/uv.lock +0 -0
|
@@ -620,9 +620,22 @@ def pull(
|
|
|
620
620
|
list[str],
|
|
621
621
|
typer.Option("--dvc-arg", help="Additional DVC args."),
|
|
622
622
|
] = [],
|
|
623
|
+
force: Annotated[
|
|
624
|
+
bool,
|
|
625
|
+
typer.Option(
|
|
626
|
+
"--force",
|
|
627
|
+
"-f",
|
|
628
|
+
help="Force pull, potentially overwriting local changes.",
|
|
629
|
+
),
|
|
630
|
+
] = False,
|
|
623
631
|
):
|
|
624
632
|
"""Pull with both Git and DVC."""
|
|
625
633
|
typer.echo("Git pulling")
|
|
634
|
+
if force:
|
|
635
|
+
if "-f" not in git_args and "--force" not in git_args:
|
|
636
|
+
git_args.append("-f")
|
|
637
|
+
if "-f" not in dvc_args and "--force" not in dvc_args:
|
|
638
|
+
dvc_args.append("-f")
|
|
626
639
|
try:
|
|
627
640
|
subprocess.check_call(["git", "pull"] + git_args)
|
|
628
641
|
except subprocess.CalledProcessError:
|
|
@@ -174,12 +174,14 @@ def execute_notebook(
|
|
|
174
174
|
)
|
|
175
175
|
folder = os.path.dirname(fpath_out_exec)
|
|
176
176
|
os.makedirs(folder, exist_ok=True)
|
|
177
|
+
notebook_dir = os.path.dirname(path) or None
|
|
177
178
|
papermill.execute_notebook(
|
|
178
179
|
input_path=path,
|
|
179
180
|
output_path=fpath_out_exec,
|
|
180
181
|
kernel_name=kernel_name,
|
|
181
182
|
log_output=True,
|
|
182
183
|
parameters=parsed_params,
|
|
184
|
+
cwd=notebook_dir,
|
|
183
185
|
)
|
|
184
186
|
for to_fmt in to:
|
|
185
187
|
if to_fmt != "notebook":
|
|
@@ -16,10 +16,19 @@ class RangeIteration(BaseModel):
|
|
|
16
16
|
|
|
17
17
|
@property
|
|
18
18
|
def values(self) -> list[int | float]:
|
|
19
|
+
# Determine precision from inputs
|
|
20
|
+
def get_decimal_places(num):
|
|
21
|
+
return len(str(num).split(".")[-1]) if "." in str(num) else 0
|
|
22
|
+
|
|
23
|
+
max_precision = max(
|
|
24
|
+
get_decimal_places(self.range.start),
|
|
25
|
+
get_decimal_places(self.range.stop),
|
|
26
|
+
get_decimal_places(self.range.step),
|
|
27
|
+
)
|
|
19
28
|
vals = []
|
|
20
29
|
current = self.range.start
|
|
21
30
|
while current < self.range.stop:
|
|
22
|
-
vals.append(current)
|
|
31
|
+
vals.append(round(current, max_precision))
|
|
23
32
|
current += self.range.step
|
|
24
33
|
return vals
|
|
25
34
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Tests for ``calkit.cli.notebooks``."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import shutil
|
|
5
|
+
import subprocess
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_clean_notebook_outputs(tmp_dir):
|
|
9
|
+
# Copy in a test notebook and clean it
|
|
10
|
+
nb_fpath = os.path.join(
|
|
11
|
+
os.path.dirname(__file__), "..", "..", "..", "test", "pipeline.ipynb"
|
|
12
|
+
)
|
|
13
|
+
shutil.copy(nb_fpath, "notebook.ipynb")
|
|
14
|
+
subprocess.check_call(["calkit", "nb", "clean", "notebook.ipynb"])
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_execute_notebook(tmp_dir):
|
|
18
|
+
subprocess.check_call(
|
|
19
|
+
[
|
|
20
|
+
"calkit",
|
|
21
|
+
"new",
|
|
22
|
+
"project",
|
|
23
|
+
".",
|
|
24
|
+
"-n",
|
|
25
|
+
"cool-project",
|
|
26
|
+
"--title",
|
|
27
|
+
"Cool project",
|
|
28
|
+
]
|
|
29
|
+
)
|
|
30
|
+
subprocess.check_call(
|
|
31
|
+
["calkit", "new", "uv-venv", "-n", "main", "ipykernel"]
|
|
32
|
+
)
|
|
33
|
+
nb_fpath = os.path.join(
|
|
34
|
+
os.path.dirname(__file__), "..", "..", "..", "test", "nb-subdir.ipynb"
|
|
35
|
+
)
|
|
36
|
+
os.makedirs("notebooks/results")
|
|
37
|
+
shutil.copy(nb_fpath, "notebooks/main.ipynb")
|
|
38
|
+
subprocess.check_call(
|
|
39
|
+
["calkit", "nb", "execute", "notebooks/main.ipynb", "-e", "main"]
|
|
40
|
+
)
|
|
41
|
+
assert os.path.isfile("notebooks/results/something.txt")
|
|
42
|
+
os.makedirs("results")
|
|
43
|
+
shutil.copy("notebooks/main.ipynb", "main.ipynb")
|
|
44
|
+
subprocess.check_call(
|
|
45
|
+
["calkit", "nb", "execute", "main.ipynb", "-e", "main"]
|
|
46
|
+
)
|
|
47
|
+
assert os.path.isfile("results/something.txt")
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Tests for ``calkit.models.iteration``."""
|
|
2
|
+
|
|
3
|
+
from calkit.models.iteration import RangeIteration, RangeIterationParams
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_rangeiteration():
|
|
7
|
+
r = RangeIteration(range=RangeIterationParams(start=0, stop=10, step=2))
|
|
8
|
+
assert r.values == [0, 2, 4, 6, 8]
|
|
9
|
+
r = RangeIteration(
|
|
10
|
+
range=RangeIterationParams(start=0.05, stop=0.25, step=0.1)
|
|
11
|
+
)
|
|
12
|
+
assert r.values == [0.05, 0.15]
|
|
13
|
+
r = RangeIteration(range=RangeIterationParams(start=0.5, stop=1, step=0.2))
|
|
14
|
+
assert r.values == [0.5, 0.7, 0.9]
|
|
15
|
+
r = RangeIteration(range=RangeIterationParams(start=0, stop=1, step=0.2))
|
|
16
|
+
assert r.values == [0.0, 0.2, 0.4, 0.6, 0.8]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"id": "0",
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"source": [
|
|
8
|
+
"This notebook tests that we can operate on a subfolder in our project."
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cell_type": "code",
|
|
13
|
+
"execution_count": null,
|
|
14
|
+
"id": "1",
|
|
15
|
+
"metadata": {},
|
|
16
|
+
"outputs": [],
|
|
17
|
+
"source": [
|
|
18
|
+
"with open(\"results/something.txt\", \"w\") as f:\n",
|
|
19
|
+
" f.write(\"It works!\")"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"metadata": {
|
|
24
|
+
"language_info": {
|
|
25
|
+
"name": "python"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"nbformat": 4,
|
|
29
|
+
"nbformat_minor": 5
|
|
30
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"""Tests for ``calkit.cli.notebooks``."""
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import shutil
|
|
5
|
-
import subprocess
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def test_clean_notebook_outputs(tmp_dir):
|
|
9
|
-
# Copy in a test notebook and clean it
|
|
10
|
-
nb_fpath = os.path.join(
|
|
11
|
-
os.path.dirname(__file__), "..", "..", "..", "test", "pipeline.ipynb"
|
|
12
|
-
)
|
|
13
|
-
shutil.copy(nb_fpath, "notebook.ipynb")
|
|
14
|
-
subprocess.check_call(["calkit", "nb", "clean", "notebook.ipynb"])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/editor-split.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/new-project.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/new-pub-2.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/new-token.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/paper.tex.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/latex-codespaces/project-home-3.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/insert-link-to-file.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/pipeline-out-of-date.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/status-more-rows.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/uncommitted-changes.png
RENAMED
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/updated-publication.png
RENAMED
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/office/word-to-pdf-stage-2.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/create-project.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{calkit_python-0.27.0 → calkit_python-0.27.2}/docs/tutorials/img/openfoam/figure-on-website.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|