galform-execution 0.2.0__tar.gz → 0.2.2__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. {galform_execution-0.2.0 → galform_execution-0.2.2}/PKG-INFO +1 -1
  2. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/__init__.py +1 -1
  3. galform_execution-0.2.2/galform_execution/config/simulations/colibre_family.json +43 -0
  4. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/simulations/eagle_family.json +6 -6
  5. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/simulations/flamingo_family.json +8 -3
  6. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/simulations/millennium_family.json +2 -2
  7. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/simulations/nifty_family.json +2 -1
  8. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/submit_galform_job.py +23 -0
  9. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution.egg-info/PKG-INFO +1 -1
  10. {galform_execution-0.2.0 → galform_execution-0.2.2}/pyproject.toml +1 -1
  11. {galform_execution-0.2.0 → galform_execution-0.2.2}/tests/test_submit_galform_job.py +49 -0
  12. galform_execution-0.2.0/galform_execution/config/simulations/colibre_family.json +0 -20
  13. {galform_execution-0.2.0 → galform_execution-0.2.2}/LICENSE +0 -0
  14. {galform_execution-0.2.0 → galform_execution-0.2.2}/README.md +0 -0
  15. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/__main__.py +0 -0
  16. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/dust_params.json +0 -0
  17. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/models.json +0 -0
  18. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/partition_configs.json +0 -0
  19. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/redshift_lists/COLIBRE-L100m6.txt +0 -0
  20. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/redshift_lists/FLAMINGO-L1000N1800.txt +0 -0
  21. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/redshift_lists/L800.txt +0 -0
  22. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/redshift_lists/Mill1.txt +0 -0
  23. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/redshift_lists/Mill2.txt +0 -0
  24. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/run_flags.json +0 -0
  25. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution/config/simulations/dove_family.json +0 -0
  26. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution.egg-info/SOURCES.txt +0 -0
  27. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution.egg-info/dependency_links.txt +0 -0
  28. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution.egg-info/entry_points.txt +0 -0
  29. {galform_execution-0.2.0 → galform_execution-0.2.2}/galform_execution.egg-info/top_level.txt +0 -0
  30. {galform_execution-0.2.0 → galform_execution-0.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: galform_execution
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: GALFORM execution helper utilities
5
5
  Author: Oscar Hickman
6
6
  License: MIT
@@ -2,4 +2,4 @@
2
2
  galform_execution: Python-based utility to manage GALFORM N-body simulation submissions to SLURM.
3
3
  """
4
4
 
5
- __version__ = "0.1.6"
5
+ __version__ = "0.2.2"
@@ -0,0 +1,43 @@
1
+ {
2
+ "COLIBRE-L100m6": {
3
+ "aquarius_particle_file": "/cosma8/data/dp004/jch/COLIBRE/HBT/L100_m6/DMO/trees/particle_lists/particle_list_127",
4
+ "aquarius_tree_file": "/cosma8/data/dp004/jch/COLIBRE/HBT/L100_m6/DMO/trees/tree_127",
5
+ "h0": 0.681,
6
+ "iz0": 127,
7
+ "iz_list": [
8
+ 127,
9
+ 102,
10
+ 92
11
+ ],
12
+ "lambda0": 0.693922,
13
+ "lbox": 68.1,
14
+ "mpart": 1569616.5,
15
+ "nbody_trees_dir": "/cosma8/data/dp004/jch/COLIBRE/HBT/L100_m6/DMO/trees",
16
+ "nvol_range": "1-64",
17
+ "omega0": 0.306078,
18
+ "omegab": 0.0486,
19
+ "pk_file": "Power_Spec/pk_FLAMINGO_DMO_FIDUCIAL.dat",
20
+ "sigma8": 0.807,
21
+ "snapshot_file": "COLIBRE-L100m6.txt",
22
+ "volume": 4934.706890625
23
+ },
24
+ "COLIBRE-L400m7": {
25
+ "_note": "GALFORM-format aquarius trees not yet built from COLIBRE DMO. dhalo trees at /cosma7/data/dp004/jch/COLIBRE/L400_m7/DMO/dhalo_trees/ (not yet in GALFORM aquarius format). Update tree paths and iz0/iz_list/nvol_range before submitting.",
26
+ "aquarius_particle_file": "/cosma5/data/jch/Galform/Merger_Trees/COLIBRE/L400_m7/particle_lists/particle_list_TBD",
27
+ "aquarius_tree_file": "/cosma5/data/jch/Galform/Merger_Trees/COLIBRE/L400_m7/treedir_TBD/tree_TBD",
28
+ "h0": 0.681,
29
+ "iz0": null,
30
+ "iz_list": [],
31
+ "lambda0": 0.693922,
32
+ "lbox": 272.4,
33
+ "mpart": 12556932.0,
34
+ "nbody_trees_dir": "/cosma5/data/jch/Galform/Merger_Trees/COLIBRE/L400_m7",
35
+ "nvol_range": "1-64",
36
+ "omega0": 0.306078,
37
+ "omegab": 0.0486,
38
+ "pk_file": "Power_Spec/pk_COLIBRE_norm.dat",
39
+ "sigma8": 0.807,
40
+ "snapshot_file": "/cosma5/data/jch/Galform/Merger_Trees/COLIBRE/L400_m7/redshift_list.txt",
41
+ "volume": null
42
+ }
43
+ }
@@ -8,8 +8,8 @@
8
8
  200
9
9
  ],
10
10
  "lambda0": 0.693,
11
- "lbox": null,
12
- "mpart": null,
11
+ "lbox": 67.77,
12
+ "mpart": 7795580.0,
13
13
  "nbody_trees_dir": "/cosma7/data/dp004/jch/Eagle/Merger_Trees/DMONLY/L0100N1504",
14
14
  "nvol_range": "1-128",
15
15
  "omega0": 0.307,
@@ -28,8 +28,8 @@
28
28
  101
29
29
  ],
30
30
  "lambda0": 0.693,
31
- "lbox": null,
32
- "mpart": null,
31
+ "lbox": 67.77,
32
+ "mpart": 7795580.0,
33
33
  "nbody_trees_dir": "/cosma7/data/dp004/jch/Eagle/Merger_Trees/DMONLY/L0100N1504/trees_snapnums100",
34
34
  "nvol_range": "1-128",
35
35
  "omega0": 0.307,
@@ -48,8 +48,8 @@
48
48
  67
49
49
  ],
50
50
  "lambda0": 0.693,
51
- "lbox": null,
52
- "mpart": null,
51
+ "lbox": 67.77,
52
+ "mpart": 7795580.0,
53
53
  "nbody_trees_dir": "/cosma7/data/dp004/jch/Eagle/Merger_Trees/DMONLY/L0100N1504/trees_snapnums62",
54
54
  "nvol_range": "1-128",
55
55
  "omega0": 0.307,
@@ -4,10 +4,15 @@
4
4
  "aquarius_tree_file": "/cosma8/data/dp004/jch/FLAMINGO/HBT/L1000N1800/DMO_FIDUCIAL/trees/tree_077",
5
5
  "h0": 0.681,
6
6
  "iz0": 77,
7
- "iz_list": [77, 67, 57, 37],
7
+ "iz_list": [
8
+ 77,
9
+ 67,
10
+ 57,
11
+ 37
12
+ ],
8
13
  "lambda0": 0.693922,
9
14
  "lbox": 681.0,
10
- "mpart": 4599600000.0,
15
+ "mpart": 4578145711.0,
11
16
  "nbody_trees_dir": "/cosma8/data/dp004/jch/FLAMINGO/HBT/L1000N1800/DMO_FIDUCIAL/trees",
12
17
  "nvol_range": "1-64",
13
18
  "omega0": 0.306078,
@@ -15,6 +20,6 @@
15
20
  "pk_file": "Power_Spec/pk_FLAMINGO_DMO_FIDUCIAL.dat",
16
21
  "sigma8": 0.807,
17
22
  "snapshot_file": "FLAMINGO-L1000N1800.txt",
18
- "volume": 315821241.0
23
+ "volume": 4934706.890625
19
24
  }
20
25
  }
@@ -91,7 +91,7 @@
91
91
  "volume": 1953125.0
92
92
  },
93
93
  "MillGas62.5": {
94
- "_note": "Tree files not present on disk — lbox/mpart unverified.",
94
+ "_note": "Tree files not present on disk — lbox/mpart unverified. Previous volume=1953125.0 was a copy-paste from the 500 Mpc/h MillGas box and wrong for a 62.5 box; set to null.",
95
95
  "aquarius_particle_file": "/cosma5/data/jch/Galform/Merger_Trees/MillGas/dm/62.5/new/particle_lists/particle_list_061",
96
96
  "aquarius_tree_file": "/cosma5/data/jch/Galform/Merger_Trees/MillGas/dm/62.5/new/treedir_061/tree_061",
97
97
  "h0": 0.704,
@@ -109,7 +109,7 @@
109
109
  "pk_file": "Power_Spec/pk_MillGas_norm.dat",
110
110
  "sigma8": 0.81,
111
111
  "snapshot_file": "/cosma5/data/jch/Galform/Merger_Trees/MillGas/dm/62.5/new/redshift_list",
112
- "volume": 1953125.0
112
+ "volume": null
113
113
  },
114
114
  "MilliMil": {
115
115
  "aquarius_particle_file": "/cosma5/data/jch/MilliMillennium/trees/particle_lists/particle_list_063",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "nifty62.5": {
3
+ "_note": "Tree dir /cosma5/data/jch/Galform/Merger_Trees/nifty/ no longer exists on disk. Previous volume=1953125.0 was a copy-paste from the 500 Mpc/h MillGas box and wrong for a 62.5 box; set to null until trees are located.",
3
4
  "aquarius_particle_file": "",
4
5
  "aquarius_tree_file": "/cosma5/data/jch/Galform/Merger_Trees/nifty/62.5/treedir_061/tree_061",
5
6
  "h0": 0.704,
@@ -17,6 +18,6 @@
17
18
  "pk_file": "Power_Spec/pk_MillGas_norm.dat",
18
19
  "sigma8": 0.81,
19
20
  "snapshot_file": "/cosma5/data/jch/Galform/Merger_Trees/nifty/62.5/redshift_list",
20
- "volume": 1953125.0
21
+ "volume": null
21
22
  }
22
23
  }
@@ -301,6 +301,8 @@ class GalformSubmitter:
301
301
  submit_retries: int = 4,
302
302
  submit_retry_delay_s: float = 15.0,
303
303
  submit_retry_backoff: float = 2.0,
304
+ mail_user: Optional[str] = None,
305
+ mail_type: str = "END,FAIL",
304
306
  ):
305
307
  self.galform_dir = Path(galform_dir)
306
308
  self.nbody_sim = nbody_sim
@@ -324,6 +326,8 @@ class GalformSubmitter:
324
326
  self.submit_retries = max(1, int(submit_retries))
325
327
  self.submit_retry_delay_s = max(0.0, float(submit_retry_delay_s))
326
328
  self.submit_retry_backoff = max(1.0, float(submit_retry_backoff))
329
+ self.mail_user = mail_user
330
+ self.mail_type = mail_type
327
331
  self._snapshot_redshift_cache: Optional[Dict[int, float]] = None
328
332
 
329
333
  if self.output_redshifts is not None and self.output_iz_list is not None:
@@ -923,6 +927,12 @@ set SAMPLE_GALS_EXE = ${{build_dir}}/sample_gals
923
927
  else self.nvol_count
924
928
  )
925
929
 
930
+ mail_lines = (
931
+ f"#SBATCH --mail-user={self.mail_user}\n#SBATCH --mail-type={self.mail_type}"
932
+ if self.mail_user
933
+ else ""
934
+ )
935
+
926
936
  script = f"""#!/bin/bash
927
937
  #SBATCH --ntasks=1
928
938
  #SBATCH --cpus-per-task={effective_cpus}
@@ -932,6 +942,7 @@ set SAMPLE_GALS_EXE = ${{build_dir}}/sample_gals
932
942
  #SBATCH -p {self.partition}
933
943
  #SBATCH -A {self.account}
934
944
  #SBATCH -t {self.walltime}
945
+ {mail_lines}
935
946
 
936
947
  _run_worker() {{
937
948
  local task_id=$1
@@ -1103,6 +1114,16 @@ Examples:
1103
1114
  parser.add_argument(
1104
1115
  "--walltime", default="72:00:00", help="Job wall-time (default: 72:00:00)"
1105
1116
  )
1117
+ parser.add_argument(
1118
+ "--mail-user",
1119
+ default=None,
1120
+ help="Email address for SLURM job notifications",
1121
+ )
1122
+ parser.add_argument(
1123
+ "--mail-type",
1124
+ default="END,FAIL",
1125
+ help="SLURM mail event types (default: END,FAIL)",
1126
+ )
1106
1127
  parser.add_argument(
1107
1128
  "--iz-list", type=int, nargs="+", help="Override default snapshot list"
1108
1129
  )
@@ -1271,6 +1292,8 @@ Examples:
1271
1292
  partition=args.partition,
1272
1293
  account=args.account,
1273
1294
  walltime=args.walltime,
1295
+ mail_user=args.mail_user,
1296
+ mail_type=args.mail_type,
1274
1297
  iz_list=args.iz_list,
1275
1298
  nvol_range=args.nvol_range,
1276
1299
  run_flags=run_flags,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: galform_execution
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: GALFORM execution helper utilities
5
5
  Author: Oscar Hickman
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "galform_execution"
3
- version = "0.2.0"
3
+ version = "0.2.2"
4
4
  description = "GALFORM execution helper utilities"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -476,6 +476,7 @@ def test_submit_job_retries_transient_error_then_succeeds():
476
476
  nvol="101-150",
477
477
  submit_retries=3,
478
478
  submit_retry_delay_s=0.0,
479
+ log_path=str(Path(tmpdir) / "logs"),
479
480
  )
480
481
 
481
482
  transient_err = subprocess.CalledProcessError(
@@ -518,6 +519,7 @@ def test_submit_job_fails_immediately_for_non_transient_error():
518
519
  nvol="101-150",
519
520
  submit_retries=3,
520
521
  submit_retry_delay_s=0.0,
522
+ log_path=str(Path(tmpdir) / "logs"),
521
523
  )
522
524
 
523
525
  fatal_err = subprocess.CalledProcessError(
@@ -556,6 +558,7 @@ def test_submit_job_fails_after_retries_exhausted_for_transient_error():
556
558
  nvol="101-150",
557
559
  submit_retries=3,
558
560
  submit_retry_delay_s=0.0,
561
+ log_path=str(Path(tmpdir) / "logs"),
559
562
  )
560
563
 
561
564
  transient_err = subprocess.CalledProcessError(
@@ -708,6 +711,52 @@ def test_create_job_script_throttled():
708
711
  assert "--array" not in script
709
712
 
710
713
 
714
+ def test_create_job_script_mail_notifications():
715
+ """mail_user should add SBATCH mail directives; omitting it should not."""
716
+ with tempfile.TemporaryDirectory() as tmpdir:
717
+ gdir = _make_galform_dir(tmpdir)
718
+
719
+ # With email — default mail_type
720
+ submitter = GalformSubmitter(
721
+ galform_dir=gdir,
722
+ nbody_sim="L800",
723
+ model="gp14",
724
+ iz=100,
725
+ nvol="1-8",
726
+ mail_user="user@example.com",
727
+ )
728
+ script = submitter.create_job_script(iz=100, tcsh_path="/tmp/g.csh")
729
+ assert "#SBATCH --mail-user=user@example.com" in script
730
+ assert "#SBATCH --mail-type=END,FAIL" in script
731
+
732
+ # Custom mail_type
733
+ submitter_all = GalformSubmitter(
734
+ galform_dir=gdir,
735
+ nbody_sim="L800",
736
+ model="gp14",
737
+ iz=100,
738
+ nvol="1-8",
739
+ mail_user="user@example.com",
740
+ mail_type="ALL",
741
+ )
742
+ script_all = submitter_all.create_job_script(iz=100, tcsh_path="/tmp/g.csh")
743
+ assert "#SBATCH --mail-type=ALL" in script_all
744
+
745
+ # Without email — directives must be absent
746
+ submitter_no_mail = GalformSubmitter(
747
+ galform_dir=gdir,
748
+ nbody_sim="L800",
749
+ model="gp14",
750
+ iz=100,
751
+ nvol="1-8",
752
+ )
753
+ script_no_mail = submitter_no_mail.create_job_script(
754
+ iz=100, tcsh_path="/tmp/g.csh"
755
+ )
756
+ assert "--mail-user" not in script_no_mail
757
+ assert "--mail-type" not in script_no_mail
758
+
759
+
711
760
  def test_submit_job_dry_run(capsys):
712
761
  """Dry run should print both scripts and not call sbatch."""
713
762
  with tempfile.TemporaryDirectory() as tmpdir:
@@ -1,20 +0,0 @@
1
- {
2
- "COLIBRE-L100m6": {
3
- "aquarius_particle_file": "/cosma8/data/dp004/jch/COLIBRE/HBT/L100_m6/DMO/trees/particle_lists/particle_list_127",
4
- "aquarius_tree_file": "/cosma8/data/dp004/jch/COLIBRE/HBT/L100_m6/DMO/trees/tree_127",
5
- "h0": 0.681,
6
- "iz0": 127,
7
- "iz_list": [127, 102, 92],
8
- "lambda0": 0.693922,
9
- "lbox": 68.1,
10
- "mpart": 7847050.0,
11
- "nbody_trees_dir": "/cosma8/data/dp004/jch/COLIBRE/HBT/L100_m6/DMO/trees",
12
- "nvol_range": "1-64",
13
- "omega0": 0.306078,
14
- "omegab": 0.0486,
15
- "pk_file": "Power_Spec/pk_FLAMINGO_DMO_FIDUCIAL.dat",
16
- "sigma8": 0.807,
17
- "snapshot_file": "COLIBRE-L100m6.txt",
18
- "volume": 315821.241
19
- }
20
- }