calkit-python 0.8.2__tar.gz → 0.8.3__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 (58) hide show
  1. {calkit_python-0.8.2 → calkit_python-0.8.3}/PKG-INFO +1 -1
  2. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/__init__.py +1 -1
  3. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/magics.py +25 -2
  4. {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/notebook-pipeline.md +8 -1
  5. {calkit_python-0.8.2 → calkit_python-0.8.3}/test/pipeline.ipynb +8 -1
  6. {calkit_python-0.8.2 → calkit_python-0.8.3}/.github/FUNDING.yml +0 -0
  7. {calkit_python-0.8.2 → calkit_python-0.8.3}/.github/workflows/publish-test.yml +0 -0
  8. {calkit_python-0.8.2 → calkit_python-0.8.3}/.github/workflows/publish.yml +0 -0
  9. {calkit_python-0.8.2 → calkit_python-0.8.3}/.gitignore +0 -0
  10. {calkit_python-0.8.2 → calkit_python-0.8.3}/LICENSE +0 -0
  11. {calkit_python-0.8.2 → calkit_python-0.8.3}/README.md +0 -0
  12. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/__init__.py +0 -0
  13. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/config.py +0 -0
  14. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/core.py +0 -0
  15. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/import_.py +0 -0
  16. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/list.py +0 -0
  17. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/main.py +0 -0
  18. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/new.py +0 -0
  19. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/notebooks.py +0 -0
  20. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/office.py +0 -0
  21. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cloud.py +0 -0
  22. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/conda.py +0 -0
  23. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/config.py +0 -0
  24. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/core.py +0 -0
  25. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/data.py +0 -0
  26. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/docker.py +0 -0
  27. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/dvc.py +0 -0
  28. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/git.py +0 -0
  29. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/gui.py +0 -0
  30. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/jupyter.py +0 -0
  31. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/models.py +0 -0
  32. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/office.py +0 -0
  33. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/server.py +0 -0
  34. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/__init__.py +0 -0
  35. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/core.py +0 -0
  36. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/__init__.py +0 -0
  37. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/article/paper.tex +0 -0
  38. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/core.py +0 -0
  39. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/jfm.bst +0 -0
  40. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/jfm.cls +0 -0
  41. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/lineno-FLM.sty +0 -0
  42. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/paper.tex +0 -0
  43. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/upmath.sty +0 -0
  44. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/__init__.py +0 -0
  45. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/__init__.py +0 -0
  46. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/test_list.py +0 -0
  47. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/test_main.py +0 -0
  48. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/test_new.py +0 -0
  49. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_core.py +0 -0
  50. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_dvc.py +0 -0
  51. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_jupyter.py +0 -0
  52. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_magics.py +0 -0
  53. {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_templates.py +0 -0
  54. {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/adding-latex-pub-docker.md +0 -0
  55. {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/conda-envs.md +0 -0
  56. {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/img/run-proc.png +0 -0
  57. {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/procedures.md +0 -0
  58. {calkit_python-0.8.2 → calkit_python-0.8.3}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: calkit-python
3
- Version: 0.8.2
3
+ Version: 0.8.3
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.8.2"
1
+ __version__ = "0.8.3"
2
2
 
3
3
  from .core import *
4
4
  from . import git
@@ -29,6 +29,15 @@ class Calkit(Magics):
29
29
  required=True,
30
30
  type=_parse_string_arg,
31
31
  )
32
+ @magic_arguments.argument(
33
+ "--env",
34
+ nargs="?",
35
+ const=True,
36
+ help=(
37
+ "Whether or not this cell should be run in an environment. "
38
+ "If no environment name is provided, the default will be used."
39
+ ),
40
+ )
32
41
  @magic_arguments.argument(
33
42
  "--dep",
34
43
  "-d",
@@ -106,7 +115,15 @@ class Calkit(Magics):
106
115
  Then variables will be loaded back into the user namespace state by
107
116
  loading the DVC output.
108
117
  """
109
- args = magic_arguments.parse_argstring(self.stage, line)
118
+ # Allow command for this line to continue with backslashes
119
+ cell_split = cell.split("\n")
120
+ line_combined = line.strip().removesuffix("\\")
121
+ while line.strip().endswith("\\"):
122
+ newline = cell_split.pop(0)
123
+ line += newline
124
+ line_combined += " " + newline.strip().removesuffix("\\")
125
+ cell = "\n".join(cell_split)
126
+ args = magic_arguments.parse_argstring(self.stage, line_combined)
110
127
  # If an output object type is specified, make sure we only have one
111
128
  # output
112
129
  if args.out_type:
@@ -240,7 +257,13 @@ class Calkit(Magics):
240
257
  if args.out_path:
241
258
  for path in args.out_path:
242
259
  cmd += ["-o", path]
243
- cmd.append(f"python '{script_fpath}'")
260
+ stage_cmd = f"python '{script_fpath}'"
261
+ if args.env:
262
+ runenv = "calkit runenv"
263
+ if isinstance(args.env, str):
264
+ runenv += f" -n {args.env}"
265
+ stage_cmd = runenv + " -- " + stage_cmd
266
+ cmd.append(stage_cmd)
244
267
  try:
245
268
  subprocess.run(cmd, check=True, capture_output=True, text=True)
246
269
  except subprocess.CalledProcessError as e:
@@ -143,7 +143,14 @@ We can add a line that saves the figure and declare an additional output path
143
143
  and metadata like (note this requires `plotly` and `kaleido` to be installed):
144
144
 
145
145
  ```python
146
- %%stage --name plot --dep get-data:df:parquet:pandas --out fig --out-path figures/plot.png --out-type figure --out-title "A plot of the data" --out-desc "This is a plot of the data."
146
+ %%stage \
147
+ --name plot \
148
+ --dep get-data:df:parquet:pandas \
149
+ --out fig \
150
+ --out-path figures/plot.png \
151
+ --out-type figure \
152
+ --out-title "A plot of the data" \
153
+ --out-desc "This is a plot of the data."
147
154
 
148
155
  import os
149
156
 
@@ -65,7 +65,14 @@
65
65
  "metadata": {},
66
66
  "outputs": [],
67
67
  "source": [
68
- "%%stage --name plot-fig --dep get-data:df:parquet:pandas --out fig --out-path figures/plot.png --out-type figure --out-title \"A plot of the data\" --out-desc \"This is a plot of the data.\"\n",
68
+ "%%stage \\\n",
69
+ " --name plot-fig \\\n",
70
+ " --dep get-data:df:parquet:pandas \\\n",
71
+ " --out fig \\\n",
72
+ " --out-path figures/plot.png \\\n",
73
+ " --out-type figure \\\n",
74
+ " --out-title \"A plot of the data\" \\\n",
75
+ " --out-desc \"This is a plot of the data.\"\n",
69
76
  "\n",
70
77
  "import os\n",
71
78
  "\n",
File without changes
File without changes
File without changes