hyper-py-photometry 0.1.2__tar.gz → 0.1.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 (81) hide show
  1. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/.vscode/launch.json +3 -3
  2. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/PKG-INFO +2 -1
  3. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/pyproject.toml +5 -1
  4. hyper_py_photometry-0.1.3/src/hyper_py/__init__.py +21 -0
  5. hyper_py_photometry-0.1.3/src/hyper_py/__main__.py +7 -0
  6. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/hyper.py +1 -1
  7. hyper_py_photometry-0.1.3/src/hyper_py/run_hyper.py +154 -0
  8. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py_photometry.egg-info/PKG-INFO +2 -1
  9. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py_photometry.egg-info/SOURCES.txt +2 -1
  10. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py_photometry.egg-info/requires.txt +1 -0
  11. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/test/test_hyper.py +4 -0
  12. hyper_py_photometry-0.1.2/src/hyper_py/__init__.py +0 -1
  13. hyper_py_photometry-0.1.2/src/hyper_py/run_hyper.py +0 -45
  14. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/.github/workflows/Hyper-py_paper.yml +0 -0
  15. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/.github/workflows/pypi-publish.yml +0 -0
  16. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/.gitignore +0 -0
  17. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/Gaussian_comparison_Hyper_py_IDL_ALL.py +0 -0
  18. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/ellipses_map_500_Gaussians_1_centroids.reg +0 -0
  19. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/ellipses_map_500_Gaussians_1_ellipses.reg +0 -0
  20. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/ellipses_map_500_Gaussians_2_centroids.reg +0 -0
  21. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/ellipses_map_500_Gaussians_2_ellipses.reg +0 -0
  22. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/hyper_output_map_500_Gaussians_1.txt +0 -0
  23. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/hyper_output_map_500_Gaussians_2.txt +0 -0
  24. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/map_500_Gaussians_1.fits +0 -0
  25. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/map_500_Gaussians_2.fits +0 -0
  26. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/matched_flux_comparison_table.txt +0 -0
  27. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Int_1.png +0 -0
  28. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Int_2.png +0 -0
  29. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Peak_1.png +0 -0
  30. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_Peak_2.png +0 -0
  31. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Int_1.png +0 -0
  32. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Int_2.png +0 -0
  33. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Peak_1.png +0 -0
  34. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_IDL_vs_py_Peak_2.png +0 -0
  35. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_py_Int_1.png +0 -0
  36. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_py_Int_2.png +0 -0
  37. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_py_Peak_1.png +0 -0
  38. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Comparison_Hyper_py_Peak_2.png +0 -0
  39. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Diff_Histogram_Int.png +0 -0
  40. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/Flux_Diff_Histogram_Peak.png +0 -0
  41. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/combined_source_counts_comparison.txt +0 -0
  42. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/output/matched_flux_comparison_table.txt +0 -0
  43. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/photometry_sources_1300_ellipses_1300_polynomial_background_4sigma_ipac_1.txt +0 -0
  44. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/photometry_sources_1300_ellipses_1300_polynomial_background_4sigma_ipac_2.txt +0 -0
  45. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/table_500_Gaussians_1.txt +0 -0
  46. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/IDL_comparison/table_500_Gaussians_2.txt +0 -0
  47. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/LICENSE +0 -0
  48. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/README.md +0 -0
  49. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/environment.yml +0 -0
  50. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/paper/Figures/Flux_Diff_Histogram_Int.png +0 -0
  51. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/paper/Figures/Flux_Diff_Histogram_Peak.png +0 -0
  52. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/paper/paper.bib +0 -0
  53. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/paper/paper.md +0 -0
  54. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/requirements.txt +0 -0
  55. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/setup.cfg +0 -0
  56. /hyper_py_photometry-0.1.2/src/hyper_py/config.yaml → /hyper_py_photometry-0.1.3/src/hyper_py/assets/default_config.yaml +0 -0
  57. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/bkg_multigauss.py +0 -0
  58. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/bkg_single.py +0 -0
  59. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/config.py +0 -0
  60. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/create_background_slices.py +0 -0
  61. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/data_output.py +0 -0
  62. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/detection.py +0 -0
  63. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/extract_cubes.py +0 -0
  64. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/fitting.py +0 -0
  65. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/gaussfit.py +0 -0
  66. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/groups.py +0 -0
  67. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/logger.py +0 -0
  68. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/map_io.py +0 -0
  69. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/paths_io.py +0 -0
  70. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/photometry.py +0 -0
  71. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/single_map.py +0 -0
  72. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/survey.py +0 -0
  73. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py/visualization.py +0 -0
  74. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py_photometry.egg-info/dependency_links.txt +0 -0
  75. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py_photometry.egg-info/entry_points.txt +0 -0
  76. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/src/hyper_py_photometry.egg-info/top_level.txt +0 -0
  77. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/test/maps/test_2d_map_1.fits +0 -0
  78. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/test/maps/test_2d_map_2.fits +0 -0
  79. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/test/maps/test_2dmap.txt +0 -0
  80. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/test/maps/test_datacube.fits +0 -0
  81. {hyper_py_photometry-0.1.2 → hyper_py_photometry-0.1.3}/test/maps/test_datacube.txt +0 -0
@@ -6,10 +6,10 @@
6
6
  "name": "Python Debugger: Current File",
7
7
  "type": "debugpy",
8
8
  "request": "launch",
9
- // "program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
10
- "program": "${workspaceFolder}/test/test_hyper.py",
9
+ "program": "${workspaceFolder}/src/hyper_py/run_hyper.py",
10
+ //"program": "${workspaceFolder}/test/test_hyper.py",
11
11
  "console": "integratedTerminal",
12
- "args": ["${workspaceFolder}/src/hyper_py/config.yaml"],
12
+ //"args": ["${workspaceFolder}/src/hyper_py/config.yaml"],
13
13
  "env": {
14
14
  "MPLBACKEND": "TkAgg"
15
15
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyper-py-photometry
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: HYPER: Hybrid Photometry Photometry and Extraction Routine
5
5
  Author-email: Alessio Traficante <alessio.traficante@inaf.it>
6
6
  Project-URL: Homepage, https://github.com/alessio-traficante/hyper-py
@@ -15,6 +15,7 @@ Requires-Dist: scipy
15
15
  Requires-Dist: lmfit
16
16
  Requires-Dist: matplotlib
17
17
  Requires-Dist: scikit-learn<1.6,>=1.4
18
+ Requires-Dist: ruamel.yaml>=0.18
18
19
  Dynamic: license-file
19
20
 
20
21
  # 💫 `Hyper-py`: Hybrid Photometry Photometry and Extraction Routine in Python
@@ -18,7 +18,8 @@ dependencies = [
18
18
  "scipy",
19
19
  "lmfit",
20
20
  "matplotlib",
21
- "scikit-learn>=1.4,<1.6"
21
+ "scikit-learn>=1.4,<1.6",
22
+ "ruamel.yaml>=0.18"
22
23
  ]
23
24
 
24
25
  [project.urls]
@@ -32,6 +33,9 @@ hyper_py = "hyper_py.run_hyper:main"
32
33
  [tool.setuptools]
33
34
  package-dir = {"" = "src"}
34
35
 
36
+ [tool.setuptools.package-data]
37
+ hyper_py = ["assets/default_config.yaml"]
38
+
35
39
  [tool.setuptools.packages.find]
36
40
  where = ["src"]
37
41
 
@@ -0,0 +1,21 @@
1
+ """
2
+ Hyper-Py package initializer.
3
+
4
+ This file defines the public API and version metadata.
5
+ It does not run the application automatically; use
6
+ either `python -m hyper_py` or the console script entry point.
7
+ """
8
+
9
+ from importlib.metadata import version, PackageNotFoundError
10
+
11
+ from .hyper import start_hyper
12
+
13
+ try:
14
+ __version__ = version("hyper-py")
15
+ except PackageNotFoundError:
16
+ __version__ = "0.0.0-dev"
17
+
18
+ __all__ = [
19
+ "start_hyper",
20
+ "__version__",
21
+ ]
@@ -0,0 +1,7 @@
1
+ # Allows: python -m hyper_py [optional /path/to/config.yaml]
2
+ # This delegates to the same CLI logic used by the console_script entry point.
3
+
4
+ from .run_hyper import main
5
+
6
+ if __name__ == "__main__":
7
+ main()
@@ -22,7 +22,7 @@ def start_hyper(cfg_path):
22
22
  # === Load config ===
23
23
  os.chdir(os.path.dirname(__file__))
24
24
 
25
- config_path = cfg_path if not None else "config.yaml"
25
+ config_path = cfg_path if not None else "hyper_config.yaml"
26
26
 
27
27
  if not os.path.exists(config_path):
28
28
  raise FileNotFoundError(f"Config file not found: {config_path}")
@@ -0,0 +1,154 @@
1
+ import sys
2
+ import os
3
+ import warnings
4
+ import shutil
5
+ import platform
6
+ from pathlib import Path
7
+
8
+ # Silence some known irrelevant warnings
9
+ warnings.filterwarnings("ignore", message="Using UFloat objects with std_dev==0 may give unexpected results.")
10
+ warnings.filterwarnings("ignore", message=".*Set OBSGEO-L to.*")
11
+ warnings.filterwarnings("ignore", message=".*Wrapping comment lines > 78 characters.*")
12
+ warnings.filterwarnings("ignore", message=".*more axes \\(4\\) than the image it is associated with \\(2\\).*")
13
+ warnings.filterwarnings("ignore", message=".*Set MJD-OBS to.*")
14
+
15
+ # Import the main entry point of the package
16
+ from hyper_py.hyper import start_hyper
17
+
18
+ # importlib.resources for packaged data (fallback to importlib_resources on older Python)
19
+ try:
20
+ from importlib.resources import files as ir_files
21
+ except Exception: # Python <3.9
22
+ from importlib_resources import files as ir_files # type: ignore
23
+
24
+ # Try ruamel.yaml for comment-preserving roundtrips
25
+ try:
26
+ from ruamel.yaml import YAML # type: ignore
27
+ _HAS_RUAMEL = True
28
+ except Exception:
29
+ _HAS_RUAMEL = False
30
+
31
+ _PKG = "hyper_py" # top-level package name
32
+ _CONFIG_FILENAME = "hyper_config.yaml" # custom config filename
33
+
34
+
35
+ def _user_config_path() -> Path:
36
+ """Return the user-level config path depending on the operating system."""
37
+ if platform.system() == "Windows":
38
+ base = Path(os.environ.get("APPDATA", Path.home() / "AppData" / "Roaming"))
39
+ return base / "HyperPy" / _CONFIG_FILENAME
40
+ base = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"))
41
+ return base / "hyper-py" / _CONFIG_FILENAME
42
+
43
+
44
+ def _load_default_template_path() -> Path:
45
+ """
46
+ Locate the packaged default config template.
47
+ Fallback to local files when running directly from src (dev mode).
48
+ """
49
+ try:
50
+ res = ir_files(_PKG).joinpath("assets/default_config.yaml")
51
+ if res and os.path.isfile(str(res)):
52
+ return Path(str(res))
53
+ except Exception:
54
+ pass
55
+
56
+ # Fallbacks for development mode
57
+ here = Path(__file__).parent
58
+ for cand in (
59
+ here / "assets" / "default_config.yaml",
60
+ here / "config.yaml",
61
+ here.parent / "config.yaml",
62
+ ):
63
+ if cand.is_file():
64
+ return cand
65
+
66
+ print("Error: default config template not found in package or src.")
67
+ sys.exit(1)
68
+
69
+
70
+ def _ensure_parent(p: Path) -> None:
71
+ """Ensure the parent directory exists."""
72
+ p.parent.mkdir(parents=True, exist_ok=True)
73
+
74
+
75
+ def _copy_template_to(dest: Path) -> None:
76
+ """Copy the default template into the destination config file."""
77
+ src = _load_default_template_path()
78
+ _ensure_parent(dest)
79
+ with src.open("rb") as s, dest.open("wb") as d:
80
+ shutil.copyfileobj(s, d)
81
+
82
+
83
+ def _resolve_config_path(argv: list[str]) -> Path:
84
+ """Resolve the path of the configuration file from CLI args or default locations."""
85
+ # 1) CLI argument
86
+ if len(argv) > 1:
87
+ return Path(argv[1]).expanduser().resolve()
88
+ # 2) config file in the current working directory
89
+ cwd_cfg = Path.cwd() / _CONFIG_FILENAME
90
+ if cwd_cfg.is_file():
91
+ return cwd_cfg
92
+ # 3) user config path
93
+ ucfg = _user_config_path()
94
+ if ucfg.is_file():
95
+ return ucfg
96
+ # 4) if nothing found, suggest CWD/hyper_config.yaml as creation target
97
+ return cwd_cfg
98
+
99
+
100
+ def _update_dir_root_preserving_comments(config_path: Path, new_dir_root: Path) -> None:
101
+ """
102
+ Update paths.output.dir_root preserving comments and formatting using ruamel.yaml.
103
+ If ruamel.yaml is not available, do nothing (keep template intact and let the user edit).
104
+ """
105
+ if not _HAS_RUAMEL:
106
+ print("Note: ruamel.yaml not installed; left config comments intact. "
107
+ "Please edit 'paths.output.dir_root' manually in hyper_config.yaml.")
108
+ return
109
+
110
+ yaml = YAML()
111
+ yaml.preserve_quotes = True
112
+ yaml.indent(mapping=2, sequence=4, offset=2)
113
+
114
+ with config_path.open("r", encoding="utf-8") as f:
115
+ data = yaml.load(f) or {}
116
+
117
+ # Ensure nested mapping exists without destroying comments
118
+ paths = data.get("paths")
119
+ if paths is None:
120
+ from ruamel.yaml.comments import CommentedMap # type: ignore
121
+ paths = CommentedMap()
122
+ data["paths"] = paths
123
+
124
+ output = paths.get("output")
125
+ if output is None:
126
+ from ruamel.yaml.comments import CommentedMap # type: ignore
127
+ output = CommentedMap()
128
+ paths["output"] = output
129
+
130
+ output["dir_root"] = str(new_dir_root / "output")
131
+
132
+ with config_path.open("w", encoding="utf-8") as f:
133
+ yaml.dump(data, f)
134
+
135
+
136
+ def main() -> None:
137
+ """Main entry point for CLI execution."""
138
+ cfg_path = _resolve_config_path(sys.argv)
139
+
140
+ if not cfg_path.exists():
141
+ # Create new hyper_config.yaml from packaged template
142
+ _copy_template_to(cfg_path)
143
+ # Update dir_root while preserving comments (if ruamel.yaml is available)
144
+ _update_dir_root_preserving_comments(cfg_path, Path.cwd())
145
+ print(f"⚠️ New {_CONFIG_FILENAME} created at: {cfg_path}")
146
+ print("⚠️ Please edit it and run the command again.")
147
+ sys.exit(0)
148
+
149
+ # Run the real application
150
+ start_hyper(str(cfg_path))
151
+
152
+
153
+ if __name__ == "__main__":
154
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyper-py-photometry
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: HYPER: Hybrid Photometry Photometry and Extraction Routine
5
5
  Author-email: Alessio Traficante <alessio.traficante@inaf.it>
6
6
  Project-URL: Homepage, https://github.com/alessio-traficante/hyper-py
@@ -15,6 +15,7 @@ Requires-Dist: scipy
15
15
  Requires-Dist: lmfit
16
16
  Requires-Dist: matplotlib
17
17
  Requires-Dist: scikit-learn<1.6,>=1.4
18
+ Requires-Dist: ruamel.yaml>=0.18
18
19
  Dynamic: license-file
19
20
 
20
21
  # 💫 `Hyper-py`: Hybrid Photometry Photometry and Extraction Routine in Python
@@ -42,10 +42,10 @@ paper/paper.md
42
42
  paper/Figures/Flux_Diff_Histogram_Int.png
43
43
  paper/Figures/Flux_Diff_Histogram_Peak.png
44
44
  src/hyper_py/__init__.py
45
+ src/hyper_py/__main__.py
45
46
  src/hyper_py/bkg_multigauss.py
46
47
  src/hyper_py/bkg_single.py
47
48
  src/hyper_py/config.py
48
- src/hyper_py/config.yaml
49
49
  src/hyper_py/create_background_slices.py
50
50
  src/hyper_py/data_output.py
51
51
  src/hyper_py/detection.py
@@ -62,6 +62,7 @@ src/hyper_py/run_hyper.py
62
62
  src/hyper_py/single_map.py
63
63
  src/hyper_py/survey.py
64
64
  src/hyper_py/visualization.py
65
+ src/hyper_py/assets/default_config.yaml
65
66
  src/hyper_py_photometry.egg-info/PKG-INFO
66
67
  src/hyper_py_photometry.egg-info/SOURCES.txt
67
68
  src/hyper_py_photometry.egg-info/dependency_links.txt
@@ -6,3 +6,4 @@ scipy
6
6
  lmfit
7
7
  matplotlib
8
8
  scikit-learn<1.6,>=1.4
9
+ ruamel.yaml>=0.18
@@ -16,6 +16,10 @@ def find_package_config(pkg_dir: Path) -> Path:
16
16
  p = pkg_dir / name
17
17
  if p.exists():
18
18
  return p
19
+ for name in ("config.yaml","config.yml","default_config.yaml","config_default.yaml","config_base.yaml"):
20
+ p = pkg_dir / "assets" / name
21
+ if p.exists():
22
+ return p
19
23
  alts: List[Path] = list(pkg_dir.glob("*.yaml")) + list(pkg_dir.glob("*.yml"))
20
24
  if alts:
21
25
  return alts[0]
@@ -1 +0,0 @@
1
- from hyper_py.hyper import start_hyper
@@ -1,45 +0,0 @@
1
- import sys
2
- import os
3
- import shutil
4
- import warnings
5
- import yaml
6
- from pathlib import Path
7
-
8
- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
9
-
10
- # Block warnings
11
- warnings.filterwarnings("ignore", message="Using UFloat objects with std_dev==0 may give unexpected results.")
12
- warnings.filterwarnings("ignore", message=".*Set OBSGEO-L to.*")
13
- warnings.filterwarnings("ignore", message=".*Wrapping comment lines > 78 characters.*")
14
- warnings.filterwarnings("ignore", message=".*more axes \(4\) than the image it is associated with \(2\).*")
15
- warnings.filterwarnings("ignore", message=".*Set MJD-OBS to.*")
16
-
17
- from hyper_py.hyper import start_hyper
18
-
19
- def update_dir_root(default_config, config_path, new_dir_root):
20
- """Create a new config.yaml in the specified directory with updated dir_root."""
21
- default_config = Path(default_config)
22
- config_path = Path(config_path)
23
- cfg = yaml.safe_load(default_config.read_text(encoding="utf-8")) or {}
24
- cfg['paths']['output']['dir_root'] = str(Path(new_dir_root, "output"))
25
- config_path.write_text(yaml.safe_dump(cfg, sort_keys=False), encoding="utf-8")
26
-
27
- def main():
28
- config_path = sys.argv[1] if len(sys.argv) > 1 else "config.yaml"
29
- if not os.path.exists(config_path):
30
- default_config = os.path.join(os.path.dirname(__file__), "config.yaml")
31
- if not os.path.exists(default_config):
32
- print("Error: default config.yaml not found.")
33
- sys.exit(1)
34
-
35
- config_path = os.path.join(os.getcwd(), "config.yaml")
36
-
37
- update_dir_root(default_config, config_path, os.getcwd())
38
- print(f"⚠️ New config.yaml created in {config_path}")
39
- print("⚠️ Please edit the configuration file and set the correct parameters and paths before running again.")
40
- sys.exit(0)
41
-
42
- start_hyper(config_path)
43
-
44
- if __name__ == "__main__":
45
- main()