slurm-code 0.1.26__tar.gz → 0.1.30__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 (72) hide show
  1. {slurm_code-0.1.26/src/slurm_code.egg-info → slurm_code-0.1.30}/PKG-INFO +1 -1
  2. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/submit.md +2 -2
  3. {slurm_code-0.1.26 → slurm_code-0.1.30}/pixi.lock +12 -11
  4. {slurm_code-0.1.26 → slurm_code-0.1.30}/pyproject.toml +3 -2
  5. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/cli.py +2 -1
  6. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/core.py +26 -16
  7. {slurm_code-0.1.26 → slurm_code-0.1.30/src/slurm_code.egg-info}/PKG-INFO +1 -1
  8. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/Dockerfile +0 -0
  9. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/README.md +0 -0
  10. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/devcontainer.json +0 -0
  11. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/init-firewall.sh +0 -0
  12. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/generate-config.sh +0 -0
  13. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/install.sh +0 -0
  14. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/pixi.toml +0 -0
  15. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/servers.txt +0 -0
  16. {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/test-servers.sh +0 -0
  17. {slurm_code-0.1.26 → slurm_code-0.1.30}/.gitattributes +0 -0
  18. {slurm_code-0.1.26 → slurm_code-0.1.30}/.github/workflows/conda-release.yml +0 -0
  19. {slurm_code-0.1.26 → slurm_code-0.1.30}/.github/workflows/pypi-release.yml +0 -0
  20. {slurm_code-0.1.26 → slurm_code-0.1.30}/.github/workflows/quarto-publish.yml +0 -0
  21. {slurm_code-0.1.26 → slurm_code-0.1.30}/.gitignore +0 -0
  22. {slurm_code-0.1.26 → slurm_code-0.1.30}/.vscode/vscode.css +0 -0
  23. {slurm_code-0.1.26 → slurm_code-0.1.30}/CHANGELOG.md +0 -0
  24. {slurm_code-0.1.26 → slurm_code-0.1.30}/CLAUDE.md +0 -0
  25. {slurm_code-0.1.26 → slurm_code-0.1.30}/LICENSE +0 -0
  26. {slurm_code-0.1.26 → slurm_code-0.1.30}/README.md +0 -0
  27. {slurm_code-0.1.26 → slurm_code-0.1.30}/conda-build/README.md +0 -0
  28. {slurm_code-0.1.26 → slurm_code-0.1.30}/conda-build/build_env.yaml +0 -0
  29. {slurm_code-0.1.26 → slurm_code-0.1.30}/conda-build/meta.yaml +0 -0
  30. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/.gitignore +0 -0
  31. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/README.md +0 -0
  32. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_extensions/machow/interlinks/.gitignore +0 -0
  33. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_extensions/machow/interlinks/_extension.yml +0 -0
  34. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_extensions/machow/interlinks/interlinks.lua +0 -0
  35. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_inv/griffe_objects.txt +0 -0
  36. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_inv/numpy_objects.txt +0 -0
  37. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_inv/python_objects.txt +0 -0
  38. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_quarto.yml +0 -0
  39. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/_sidebar.yml +0 -0
  40. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/_styles-quartodoc.css +0 -0
  41. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/functionname.qmd +0 -0
  42. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/index.qmd +0 -0
  43. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/scriptname.qmd +0 -0
  44. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/autodoc.mustache +0 -0
  45. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/custom.scss +0 -0
  46. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/objects.txt +0 -0
  47. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/example.ipynb +0 -0
  48. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/getting-started.md +0 -0
  49. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/managing-jobs.md +0 -0
  50. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/overview.ipynb +0 -0
  51. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/profiles.md +0 -0
  52. {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/styles.css +0 -0
  53. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/bump_changelog.py +0 -0
  54. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/bump_version.py +0 -0
  55. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/docs-build-render.sh +0 -0
  56. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/docs-run-notebooks.sh +0 -0
  57. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/git-commit.sh +0 -0
  58. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/github-release.sh +0 -0
  59. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/rename.py +0 -0
  60. {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/tmux-project.sh +0 -0
  61. {slurm_code-0.1.26 → slurm_code-0.1.30}/setup.cfg +0 -0
  62. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/__init__.py +0 -0
  63. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/config.py +0 -0
  64. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/gdk-code.py +0 -0
  65. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/SOURCES.txt +0 -0
  66. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/dependency_links.txt +0 -0
  67. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/entry_points.txt +0 -0
  68. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/requires.txt +0 -0
  69. {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/top_level.txt +0 -0
  70. {slurm_code-0.1.26 → slurm_code-0.1.30}/test/__init__.py +0 -0
  71. {slurm_code-0.1.26 → slurm_code-0.1.30}/test/test_dummy.py +0 -0
  72. {slurm_code-0.1.26 → slurm_code-0.1.30}/test/test_modulename.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: slurm-code
3
- Version: 0.1.26
3
+ Version: 0.1.30
4
4
  Summary: Project description
5
5
  Author-email: Your Name <your@email.com>
6
6
  License: MIT
@@ -104,7 +104,7 @@ slurm-code submit -A my_account
104
104
 
105
105
  #### SLURM environment variables
106
106
 
107
- When a `DIRECTORY` is given, slurm-code writes the job's SLURM environment variables (such as `SLURM_JOB_ID`, `SLURM_CPUS_PER_TASK`, `SLURM_MEM_PER_CPU`, etc.) to `<DIRECTORY>/.slurm-code-slurm-env.sh`. This makes the variables available in VSCode integrated terminals, which would otherwise not have them since they run outside the job's process tree.
107
+ When a `DIRECTORY` is given, slurm-code writes the job's SLURM environment variables (such as `VS_SLURM_JOB_ID`, `VS_SLURM_CPUS_PER_TASK`, `VS_SLURM_MEM_PER_CPU`, etc.) to `<DIRECTORY>/.slurm-code-slurm-env.sh`. These use a `VS_` prefix to avoid colliding with native SLURM variables (which would interfere with `sbatch` and `srun`). The variables are available in VSCode integrated terminals, which would otherwise not have them since they run outside the job's process tree.
108
108
 
109
109
  #### Pixi activation
110
110
 
@@ -120,7 +120,7 @@ On first use, you will be prompted to add a source line to `~/.bashrc` on the cl
120
120
 
121
121
  The bashrc hook does two things:
122
122
 
123
- 1. Sources `~/.slurm-code-env.sh` (a loader that is overwritten on each submit with absolute paths to the current project's SLURM env script). This provides SLURM variables like `SLURM_JOB_ID` and `SLURM_MEM_PER_CPU` in every shell.
123
+ 1. Sources `~/.slurm-code-env.sh` (a loader that is overwritten on each submit with absolute paths to the current project's SLURM env script). This provides variables like `VS_SLURM_JOB_ID` and `VS_SLURM_MEM_PER_CPU` in every shell.
124
124
  2. Sources `.slurm-code-pixi-env.sh` using a **relative** path, so pixi activation only happens when the shell starts in the project directory (as VSCode integrated terminals do). A regular SSH login starts in `~` and is unaffected.
125
125
 
126
126
  ### Profiles
@@ -279,7 +279,7 @@ environments:
279
279
  - conda: https://conda.anaconda.org/conda-forge/linux-64/tokenizers-0.22.2-py313h4d6fefd_0.conda
280
280
  - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda
281
281
  - conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.5.3-py313h07c4f96_0.conda
282
- - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.1-pyhd8ed1ab_1.conda
282
+ - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyh8f84b5b_0.conda
283
283
  - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda
284
284
  - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.20.0-pyhcf101f3_1.conda
285
285
  - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda
@@ -603,7 +603,7 @@ environments:
603
603
  - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tokenizers-0.22.2-py313h4bd1e59_0.conda
604
604
  - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda
605
605
  - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tornado-6.5.3-py313h6535dbc_0.conda
606
- - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.1-pyhd8ed1ab_1.conda
606
+ - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyh8f84b5b_0.conda
607
607
  - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda
608
608
  - conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.20.0-pyhcf101f3_1.conda
609
609
  - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda
@@ -9187,17 +9187,18 @@ packages:
9187
9187
  - pkg:pypi/tornado?source=hash-mapping
9188
9188
  size: 880049
9189
9189
  timestamp: 1765836649731
9190
- - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.1-pyhd8ed1ab_1.conda
9191
- sha256: 11e2c85468ae9902d24a27137b6b39b4a78099806e551d390e394a8c34b48e40
9192
- md5: 9efbfdc37242619130ea42b1cc4ed861
9190
+ - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyh8f84b5b_0.conda
9191
+ sha256: 9ef8e47cf00e4d6dcc114eb32a1504cc18206300572ef14d76634ba29dfe1eb6
9192
+ md5: e5ce43272193b38c2e9037446c1d9206
9193
9193
  depends:
9194
- - colorama
9195
- - python >=3.9
9196
- license: MPL-2.0 or MIT
9194
+ - python >=3.10
9195
+ - __unix
9196
+ - python
9197
+ license: MPL-2.0 and MIT
9197
9198
  purls:
9198
- - pkg:pypi/tqdm?source=hash-mapping
9199
- size: 89498
9200
- timestamp: 1735661472632
9199
+ - pkg:pypi/tqdm?source=compressed-mapping
9200
+ size: 94132
9201
+ timestamp: 1770153424136
9201
9202
  - conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyha7b4d00_0.conda
9202
9203
  sha256: 63cc2def6e168622728c7800ed6b3c1761ceecb18b354c81cee1a0a94c09900a
9203
9204
  md5: af77160f8428924c17db94e04aa69409
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "slurm-code"
7
- version = "0.1.26"
7
+ version = "0.1.30"
8
8
  description = "Project description"
9
9
  authors = [
10
10
  {name = "Your Name", email = "your@email.com"}
@@ -61,6 +61,7 @@ ipython = "*"
61
61
  seaborn = "*"
62
62
  nbdime = "*"
63
63
  r-rsvg = "*"
64
+ tqdm = ">=4.67.3,<5"
64
65
 
65
66
  # [tool.pixi.pypi-dependencies]
66
67
  # slurm-code = { path = ".", editable = true }
@@ -72,7 +73,7 @@ default = {solve-group = "default"}
72
73
  cmd = "python ./scripts/rename.py && gh repo set-default https://github.com/munch-group/$(basename $(git rev-parse --show-toplevel)) && git add src && git add -u"
73
74
 
74
75
  [tool.pixi.tasks.install-dev]
75
- cmd = "XLA_FFI_INCLUDE_DIR=$(python -c 'from jax import ffi; print(ffi.include_dir())') pip install --no-build-isolation --force-reinstall --no-deps ."
76
+ cmd = "pip install --no-build-isolation --force-reinstall --no-deps ."
76
77
  description = "Install phasic in development mode with FFI support"
77
78
 
78
79
  [tool.pixi.tasks.notebook]
@@ -12,6 +12,7 @@ from slurm_code.config import (
12
12
  load_config,
13
13
  )
14
14
  from slurm_code.core import (
15
+ JOB_NAME_PREFIX,
15
16
  add_bashrc_hook,
16
17
  build_sbatch_command,
17
18
  cancel_managed_jobs,
@@ -289,7 +290,7 @@ def reconnect(ctx, directory):
289
290
  from slurm_code.core import expand_node_list, get_job_node
290
291
 
291
292
  running_jobs = list_managed_jobs(host, all_states=False)
292
- matches = [j for j in running_jobs if j["name"].endswith(f"-{basename}")]
293
+ matches = [j for j in running_jobs if j["name"].startswith(f"{JOB_NAME_PREFIX}{basename}")]
293
294
 
294
295
  if not matches:
295
296
  click.echo(
@@ -64,12 +64,16 @@ def check_remote_directory(directory, host="gdk"):
64
64
  def derive_job_name(directory=None):
65
65
  """Derive a job name from a directory path, or from a timestamp if no directory.
66
66
 
67
- E.g. ~/projects/my-analysis -> sc-my-analysis
67
+ A short timestamp suffix ensures uniqueness when multiple jobs target
68
+ the same directory.
69
+
70
+ E.g. ~/projects/my-analysis -> sc-my-analysis-0318-1430
68
71
  None -> sc-20260302-143022
69
72
  """
73
+ ts = datetime.now().strftime("%m%d-%H%M")
70
74
  if directory:
71
75
  basename = os.path.basename(directory.rstrip("/"))
72
- return f"{JOB_NAME_PREFIX}{basename}"
76
+ return f"{JOB_NAME_PREFIX}{basename}-{ts}"
73
77
  return f"{JOB_NAME_PREFIX}{datetime.now().strftime('%Y%m%d-%H%M%S')}"
74
78
 
75
79
 
@@ -183,15 +187,15 @@ LOADER_SCRIPT = ".slurm-code-env.sh" # written to ~ on each submit
183
187
 
184
188
  # Mapping from scontrol field names to SLURM environment variable names
185
189
  _SCONTROL_TO_ENV = {
186
- "JobId": "SLURM_JOB_ID",
187
- "JobName": "SLURM_JOB_NAME",
188
- "Partition": "SLURM_JOB_PARTITION",
189
- "Account": "SLURM_JOB_ACCOUNT",
190
- "NumNodes": "SLURM_JOB_NUM_NODES",
191
- "NumCPUs": "SLURM_CPUS_ON_NODE",
192
- "NodeList": "SLURM_JOB_NODELIST",
193
- "TimeLimit": "SLURM_TIMELIMIT",
194
- "WorkDir": "SLURM_SUBMIT_DIR",
190
+ "JobId": "VS_SLURM_JOB_ID",
191
+ "JobName": "VS_SLURM_JOB_NAME",
192
+ "Partition": "VS_SLURM_JOB_PARTITION",
193
+ "Account": "VS_SLURM_JOB_ACCOUNT",
194
+ "NumNodes": "VS_SLURM_JOB_NUM_NODES",
195
+ "NumCPUs": "VS_SLURM_CPUS_ON_NODE",
196
+ "NodeList": "VS_SLURM_JOB_NODELIST",
197
+ "TimeLimit": "VS_SLURM_TIMELIMIT",
198
+ "WorkDir": "VS_SLURM_SUBMIT_DIR",
195
199
  }
196
200
 
197
201
 
@@ -239,17 +243,17 @@ def setup_slurm_env(jobid, directory, host="gdk"):
239
243
  unit = match.group(2).upper()
240
244
  multipliers = {"": 1, "K": 1, "M": 1, "G": 1024, "T": 1024 * 1024}
241
245
  mb_value = num * multipliers.get(unit, 1)
242
- lines.append(f"export SLURM_MEM_PER_CPU={mb_value!r}")
246
+ lines.append(f"export VS_SLURM_MEM_PER_CPU={mb_value!r}")
243
247
 
244
248
  # CPUs per task from ReqTRES or TresPerTask
245
249
  cpus_per_task = fields.get("CPUs/Task")
246
250
  if cpus_per_task:
247
- lines.append(f"export SLURM_CPUS_PER_TASK={cpus_per_task!r}")
251
+ lines.append(f"export VS_SLURM_CPUS_PER_TASK={cpus_per_task!r}")
248
252
 
249
253
  # NTasks
250
254
  ntasks = fields.get("NumTasks")
251
255
  if ntasks:
252
- lines.append(f"export SLURM_NTASKS={ntasks!r}")
256
+ lines.append(f"export VS_SLURM_NTASKS={ntasks!r}")
253
257
 
254
258
  script_content = "\n".join(lines) + "\n"
255
259
  script_path = f"{directory}/{SLURM_ENV_SCRIPT}"
@@ -537,8 +541,14 @@ def cancel_managed_jobs(host="gdk", job_id=None, job_name=None, cancel_all=False
537
541
  # If user passed a bare name without any known prefix, add the current one
538
542
  if not _is_managed_job(job_name):
539
543
  job_name = f"{JOB_NAME_PREFIX}{job_name}"
540
- run_remote(f"scancel --name={job_name}", host)
541
- print(f"Cancelled jobs with name {job_name}")
544
+ # Names now include a timestamp suffix, so match by prefix
545
+ jobs = list_managed_jobs(host, all_states=True)
546
+ matches = [j for j in jobs if j["name"].startswith(job_name)]
547
+ if not matches:
548
+ raise RuntimeError(f"No jobs found matching '{job_name}'")
549
+ match_ids = " ".join(j["jobid"] for j in matches)
550
+ run_remote(f"scancel {match_ids}", host)
551
+ print(f"Cancelled {len(matches)} job(s) matching '{job_name}'")
542
552
  elif cancel_all:
543
553
  jobs = list_managed_jobs(host, all_states=True)
544
554
  if not jobs:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: slurm-code
3
- Version: 0.1.26
3
+ Version: 0.1.30
4
4
  Summary: Project description
5
5
  Author-email: Your Name <your@email.com>
6
6
  License: MIT
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