calkit-python 0.17.5__tar.gz → 0.17.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 (131) hide show
  1. {calkit_python-0.17.5 → calkit_python-0.17.6}/PKG-INFO +1 -1
  2. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/__init__.py +1 -1
  3. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/main.py +48 -0
  4. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/calkit-yaml.md +1 -1
  5. calkit_python-0.17.6/docs/datasets.md +31 -0
  6. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/version-control.md +7 -0
  7. {calkit_python-0.17.5 → calkit_python-0.17.6}/mkdocs.yml +1 -0
  8. {calkit_python-0.17.5 → calkit_python-0.17.6}/.github/FUNDING.yml +0 -0
  9. {calkit_python-0.17.5 → calkit_python-0.17.6}/.github/workflows/docs.yml +0 -0
  10. {calkit_python-0.17.5 → calkit_python-0.17.6}/.github/workflows/publish-test.yml +0 -0
  11. {calkit_python-0.17.5 → calkit_python-0.17.6}/.github/workflows/publish.yml +0 -0
  12. {calkit_python-0.17.5 → calkit_python-0.17.6}/.gitignore +0 -0
  13. {calkit_python-0.17.5 → calkit_python-0.17.6}/LICENSE +0 -0
  14. {calkit_python-0.17.5 → calkit_python-0.17.6}/README.md +0 -0
  15. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/__main__.py +0 -0
  16. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/calc.py +0 -0
  17. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/check.py +0 -0
  18. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/__init__.py +0 -0
  19. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/check.py +0 -0
  20. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/config.py +0 -0
  21. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/core.py +0 -0
  22. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/import_.py +0 -0
  23. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/list.py +0 -0
  24. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/new.py +0 -0
  25. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/notebooks.py +0 -0
  26. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/office.py +0 -0
  27. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cli/update.py +0 -0
  28. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/cloud.py +0 -0
  29. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/conda.py +0 -0
  30. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/config.py +0 -0
  31. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/core.py +0 -0
  32. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/datasets.py +0 -0
  33. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/docker.py +0 -0
  34. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/dvc.py +0 -0
  35. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/git.py +0 -0
  36. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/gui.py +0 -0
  37. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/jupyter.py +0 -0
  38. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/magics.py +0 -0
  39. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/models.py +0 -0
  40. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/office.py +0 -0
  41. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/ops.py +0 -0
  42. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/server.py +0 -0
  43. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/__init__.py +0 -0
  44. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/core.py +0 -0
  45. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/__init__.py +0 -0
  46. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/article/paper.tex +0 -0
  47. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/core.py +0 -0
  48. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/jfm/jfm.bst +0 -0
  49. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/jfm/jfm.cls +0 -0
  50. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/jfm/lineno-FLM.sty +0 -0
  51. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/jfm/paper.tex +0 -0
  52. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/templates/latex/jfm/upmath.sty +0 -0
  53. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/__init__.py +0 -0
  54. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/cli/__init__.py +0 -0
  55. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/cli/test_list.py +0 -0
  56. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/cli/test_main.py +0 -0
  57. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/cli/test_new.py +0 -0
  58. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_calc.py +0 -0
  59. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_check.py +0 -0
  60. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_conda.py +0 -0
  61. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_core.py +0 -0
  62. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_dvc.py +0 -0
  63. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_jupyter.py +0 -0
  64. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_magics.py +0 -0
  65. {calkit_python-0.17.5 → calkit_python-0.17.6}/calkit/tests/test_templates.py +0 -0
  66. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/CNAME +0 -0
  67. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/apps.md +0 -0
  68. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/calculations.md +0 -0
  69. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/cli-reference.md +0 -0
  70. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/cloud-integration.md +0 -0
  71. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/environments.md +0 -0
  72. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/examples.md +0 -0
  73. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/help.md +0 -0
  74. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/img/c-to-the-k-white.svg +0 -0
  75. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/img/calkit-no-bg.png +0 -0
  76. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/index.md +0 -0
  77. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/installation.md +0 -0
  78. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/local-server.md +0 -0
  79. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/pipeline/index.md +0 -0
  80. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/pipeline/manual-steps.md +0 -0
  81. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/references.md +0 -0
  82. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/adding-latex-pub-docker.md +0 -0
  83. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/conda-envs.md +0 -0
  84. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/first-project.md +0 -0
  85. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/building-codespace.png +0 -0
  86. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/codespaces-secrets-2.png +0 -0
  87. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/editor-split.png +0 -0
  88. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/go-to-linked-code.png +0 -0
  89. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/issue-from-selection.png +0 -0
  90. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/new-project.png +0 -0
  91. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/new-pub-2.png +0 -0
  92. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/new-token.png +0 -0
  93. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/paper.tex.png +0 -0
  94. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/project-home-3.png +0 -0
  95. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/push.png +0 -0
  96. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/latex-codespaces/stage.png +0 -0
  97. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/anakin-excel.jpg +0 -0
  98. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/chart-more-rows.png +0 -0
  99. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/create-project.png +0 -0
  100. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/elsevier-research-data-guidelines.png +0 -0
  101. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/excel-chart.png +0 -0
  102. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/excel-data.png +0 -0
  103. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/insert-link-to-file.png +0 -0
  104. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/needs-clone.png +0 -0
  105. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/new-stage.png +0 -0
  106. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/phd-comics-version-control.webp +0 -0
  107. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/pipeline-out-of-date.png +0 -0
  108. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/status-more-rows.png +0 -0
  109. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/uncommitted-changes.png +0 -0
  110. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/untracked-data.png +0 -0
  111. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/updated-publication.png +0 -0
  112. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/word-to-pdf-stage-2.png +0 -0
  113. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/office/workflow-page.png +0 -0
  114. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/clone.png +0 -0
  115. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/create-project.png +0 -0
  116. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/datasets-page.png +0 -0
  117. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/figure-on-website-updated.png +0 -0
  118. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/figure-on-website.png +0 -0
  119. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/new-token.png +0 -0
  120. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/reclone.png +0 -0
  121. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/openfoam/status-after-import-dataset.png +0 -0
  122. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/img/run-proc.png +0 -0
  123. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/latex-codespaces.md +0 -0
  124. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/matlab.md +0 -0
  125. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/notebook-pipeline.md +0 -0
  126. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/office.md +0 -0
  127. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/openfoam.md +0 -0
  128. {calkit_python-0.17.5 → calkit_python-0.17.6}/docs/tutorials/procedures.md +0 -0
  129. {calkit_python-0.17.5 → calkit_python-0.17.6}/pyproject.toml +0 -0
  130. {calkit_python-0.17.5 → calkit_python-0.17.6}/test/pipeline.ipynb +0 -0
  131. {calkit_python-0.17.5 → calkit_python-0.17.6}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: calkit-python
3
- Version: 0.17.5
3
+ Version: 0.17.6
4
4
  Summary: Reproducibility simplified.
5
5
  Project-URL: Homepage, https://calkit.org
6
6
  Project-URL: Issues, https://github.com/calkit/calkit/issues
@@ -1,4 +1,4 @@
1
- __version__ = "0.17.5"
1
+ __version__ = "0.17.6"
2
2
 
3
3
  from .core import *
4
4
  from . import git
@@ -155,6 +155,27 @@ def clone(
155
155
  """Clone a Git repo and by default configure and pull from the DVC
156
156
  remote.
157
157
  """
158
+ # If the URL looks like just a project owner and name, fetch its repo URL
159
+ # first
160
+ if not url.startswith("https://") and not url.startswith("git@"):
161
+ url_split = url.split("/")
162
+ if len(url_split) != 2:
163
+ raise_error(
164
+ "Calkit projects must be specified like "
165
+ "{owner_name}/{project_name}"
166
+ )
167
+ owner_name, project_name = url_split
168
+ typer.echo("Fetching Git repo URL from the Calkit Cloud")
169
+ try:
170
+ project = calkit.cloud.get(
171
+ f"/projects/{owner_name}/{project_name}"
172
+ )
173
+ except Exception as e:
174
+ raise_error(f"Failed to fetch project information: {e}")
175
+ url = project["git_repo_url"]
176
+ # TODO: Figure out if we should clone with SSH
177
+ if not url.endswith(".git"):
178
+ url += ".git"
158
179
  # Git clone
159
180
  cmd = ["git", "clone", url]
160
181
  if recursive:
@@ -498,6 +519,33 @@ def push(
498
519
  raise_error("DVC push failed")
499
520
 
500
521
 
522
+ @app.command(name="ignore")
523
+ def ignore(
524
+ path: Annotated[str, typer.Argument(help="Path to ignore.")],
525
+ no_commit: Annotated[
526
+ bool,
527
+ typer.Option(
528
+ "--no-commit", help="Do not commit changes to .gitignore."
529
+ ),
530
+ ] = False,
531
+ ):
532
+ """Ignore a file, i.e., keep it out of version control."""
533
+ repo = git.Repo()
534
+ if repo.ignored(path):
535
+ typer.echo(f"{path} is already ignored")
536
+ exit(0)
537
+ typer.echo(f"Adding '{path}' to .gitignore")
538
+ txt = "\n" + path + "\n"
539
+ with open(".gitignore", "a") as f:
540
+ f.write(txt)
541
+ if not no_commit:
542
+ repo = git.Repo()
543
+ repo.git.reset()
544
+ repo.git.add(".gitignore")
545
+ if calkit.git.get_staged_files():
546
+ repo.git.commit(["-m", f"Ignore {path}"])
547
+
548
+
501
549
  @app.command(name="local-server")
502
550
  def run_local_server():
503
551
  """Run the local server to interact over HTTP."""
@@ -7,7 +7,7 @@ for the project's important metadata, which includes its:
7
7
  (applications, libraries, environmental variables)
8
8
  - Questions the project seeks to answer
9
9
  - Environments
10
- - Datasets
10
+ - [Datasets](datasets.md)
11
11
  - Figures
12
12
  - Publications (journal articles, conference papers, presentations, posters)
13
13
  - [Procedures](tutorials/procedures.md)
@@ -0,0 +1,31 @@
1
+ # Datasets
2
+
3
+ If your research project produces a dataset,
4
+ you can indicate it as such to make it easy for others to reuse in their
5
+ own project.
6
+ These are listed in the `datasets` section of the project's `calkit.yaml` file.
7
+
8
+ A dataset is identified by its path in the project repo,
9
+ and this path can be a folder.
10
+ For example:
11
+
12
+ ```yaml
13
+ # In calkit.yaml
14
+ datasets:
15
+ - path: data/raw-data.csv
16
+ title: Raw data
17
+ description: This is the raw data.
18
+ ```
19
+
20
+ ## Importing or reusing a dataset from another project
21
+
22
+ A dataset can be imported with the CLI like:
23
+
24
+ ```sh
25
+ calkit import dataset {owner_name}/{project_name}/{path} {local_path}
26
+ ```
27
+
28
+ If this dataset is tracked with DVC,
29
+ a new DVC remote will be created to pull it into your project.
30
+ For datasets in the Calkit Cloud,
31
+ this means the data will not be duplicated there.
@@ -122,6 +122,13 @@ The multi-step equivalent would be:
122
122
  - `calkit config remote`
123
123
  - `dvc pull`
124
124
 
125
+ If the project is hosted on the Calkit Cloud, it can be referenced by
126
+ name rather than Git repo URL. For example:
127
+
128
+ ```sh
129
+ calkit clone petebachant/strava-analysis
130
+ ```
131
+
125
132
  ### `status`
126
133
 
127
134
  `calkit status` will show the combined status from both Git and DVC.
@@ -43,6 +43,7 @@ nav:
43
43
  - pipeline/index.md
44
44
  - pipeline/manual-steps.md
45
45
  - The calkit.yaml file: calkit-yaml.md
46
+ - Datasets: datasets.md
46
47
  - Environments: environments.md
47
48
  - References: references.md
48
49
  - Calculations: calculations.md
File without changes
File without changes
File without changes