calkit-python 0.0.5__tar.gz → 0.0.6__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.
Files changed (30) hide show
  1. {calkit_python-0.0.5 → calkit_python-0.0.6}/PKG-INFO +1 -1
  2. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/__init__.py +1 -1
  3. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/cli.py +17 -4
  4. {calkit_python-0.0.5 → calkit_python-0.0.6}/.github/FUNDING.yml +0 -0
  5. {calkit_python-0.0.5 → calkit_python-0.0.6}/.github/workflows/publish-test.yml +0 -0
  6. {calkit_python-0.0.5 → calkit_python-0.0.6}/.github/workflows/publish.yml +0 -0
  7. {calkit_python-0.0.5 → calkit_python-0.0.6}/.gitignore +0 -0
  8. {calkit_python-0.0.5 → calkit_python-0.0.6}/LICENSE +0 -0
  9. {calkit_python-0.0.5 → calkit_python-0.0.6}/README.md +0 -0
  10. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/cloud.py +0 -0
  11. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/config.py +0 -0
  12. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/core.py +0 -0
  13. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/data.py +0 -0
  14. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/dvc.py +0 -0
  15. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/git.py +0 -0
  16. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/gui.py +0 -0
  17. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/jupyter.py +0 -0
  18. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/models.py +0 -0
  19. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/server.py +0 -0
  20. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/tests/__init__.py +0 -0
  21. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/tests/test_core.py +0 -0
  22. {calkit_python-0.0.5 → calkit_python-0.0.6}/calkit/tests/test_jupyter.py +0 -0
  23. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/cfd-study/README.md +0 -0
  24. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/cfd-study/calkit.yaml +0 -0
  25. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/cfd-study/config/simulations/runs.csv +0 -0
  26. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/cfd-study/notebook.ipynb +0 -0
  27. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/ms-office/.gitignore +0 -0
  28. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/ms-office/README.md +0 -0
  29. {calkit_python-0.0.5 → calkit_python-0.0.6}/examples/ms-office/calkit.yaml +0 -0
  30. {calkit_python-0.0.5 → calkit_python-0.0.6}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: calkit-python
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Reproducibility simplified.
5
5
  Project-URL: Homepage, https://github.com/calkit/calkit
6
6
  Project-URL: Issues, https://github.com/calkit/calkit/issues
@@ -1,4 +1,4 @@
1
- __version__ = "0.0.5"
1
+ __version__ = "0.0.6"
2
2
 
3
3
  from .core import *
4
4
  from . import git
@@ -270,15 +270,28 @@ def clean_notebook_outputs(path: str):
270
270
 
271
271
 
272
272
  @notebooks_app.command("execute")
273
- def execute_notebook(path: str):
274
- """Execute notebook and place a copy in the executed notebooks directory.
273
+ def execute_notebook(
274
+ path: str,
275
+ to: Annotated[
276
+ str, typer.Option("--to", help="Output format ('html' or 'notebook').")
277
+ ] = "notebook",
278
+ ):
279
+ """Execute notebook and place a copy in the relevant directory.
275
280
 
276
281
  This can be useful to use as a preprocessing DVC stage to use a clean
277
282
  notebook as a dependency for a stage that caches and executed notebook.
278
283
  """
279
284
  if os.path.isabs(path):
280
285
  raise ValueError("Path must be relative")
281
- fpath_out = os.path.join(".calkit", "notebooks", "executed", path)
286
+ if to == "html":
287
+ subdir = "html"
288
+ fname_out = path.removesuffix(".ipynb") + ".html"
289
+ elif to == "notebook":
290
+ subdir = "executed"
291
+ fname_out = path
292
+ else:
293
+ raise ValueError(f"Invalid output format: '{to}'")
294
+ fpath_out = os.path.join(".calkit", "notebooks", subdir, fname_out)
282
295
  folder = os.path.dirname(fpath_out)
283
296
  os.makedirs(folder, exist_ok=True)
284
297
  subprocess.call(
@@ -288,7 +301,7 @@ def execute_notebook(path: str):
288
301
  path,
289
302
  "--execute",
290
303
  "--to",
291
- "notebook",
304
+ to,
292
305
  "--output",
293
306
  fpath_out,
294
307
  ]
File without changes
File without changes
File without changes