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.
- {calkit_python-0.8.2 → calkit_python-0.8.3}/PKG-INFO +1 -1
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/__init__.py +1 -1
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/magics.py +25 -2
- {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/notebook-pipeline.md +8 -1
- {calkit_python-0.8.2 → calkit_python-0.8.3}/test/pipeline.ipynb +8 -1
- {calkit_python-0.8.2 → calkit_python-0.8.3}/.github/FUNDING.yml +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/.github/workflows/publish-test.yml +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/.github/workflows/publish.yml +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/.gitignore +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/LICENSE +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/README.md +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/__init__.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/config.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/core.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/import_.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/list.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/main.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/new.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/notebooks.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cli/office.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/cloud.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/conda.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/config.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/core.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/data.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/docker.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/dvc.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/git.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/gui.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/jupyter.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/models.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/office.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/server.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/__init__.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/core.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/__init__.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/article/paper.tex +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/core.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/jfm.bst +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/jfm.cls +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/lineno-FLM.sty +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/paper.tex +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/templates/latex/jfm/upmath.sty +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/__init__.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/__init__.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/test_list.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/test_main.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/cli/test_new.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_core.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_dvc.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_jupyter.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_magics.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/calkit/tests/test_templates.py +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/adding-latex-pub-docker.md +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/conda-envs.md +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/img/run-proc.png +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/docs/tutorials/procedures.md +0 -0
- {calkit_python-0.8.2 → calkit_python-0.8.3}/pyproject.toml +0 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|