Skip to content

Conversation

@eayari21
Copy link
Owner

Summary

  • move all SpectrumPY source, data, and assets into a src/spectrumpy_flight package and add packaging metadata
  • update imports, launchers, and tests to use the new package namespace and entry points
  • refresh documentation and add instructions for cutting a pip release

Testing

  • pytest

https://chatgpt.com/codex/tasks/task_e_6902449889348320ad0b5875b57eb4e1

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

def _convert_packet_file(self, path: Path) -> Optional[Path]:
output_dir = REPO_ROOT / "HDF5"
output_dir.mkdir(parents=True, exist_ok=True)
produced_path = output_dir / f"{path.name}.h5"

P1 Badge Packet converter stores HDF5 into read‑only package path

_convert_packet_file() now runs from the packaged module, but it still creates output_dir = REPO_ROOT / "HDF5". After pip installation that location is inside site-packages and cannot be created or written by normal users, so converting a packet downloaded via the launcher will fail even before subprocess.run is invoked. Use the new cache directory (e.g. ~/.spectrumpy_flight/HDF5) or another user‑writable location instead of the package directory.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 216 to 220
def run_impactbook() -> Path:
from ImpactBook import ImpactBook
from .ImpactBook import ImpactBook

ImpactBook(channel_names, trcdir=str(directory), ExperimentName=experiment_name)
return (REPO_ROOT / "HDF5" / f"{experiment_name}.h5").resolve()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid writing ImpactBook output into package directory

When running the GUI from an installed wheel, REPO_ROOT points to the package inside site-packages, which is typically read‑only for normal users. run_impactbook() writes results to REPO_ROOT / "HDF5" / <experiment>.h5, so a pip‑installed copy will raise PermissionError before any processing completes. The output directory should be moved to a user‑writable cache (as done for API downloads) rather than the package installation folder.

Useful? React with 👍 / 👎.

Comment on lines +34 to +38
package_root = resources.files("spectrumpy_flight")

for default in ("HDF5", "Data"):
resource = package_root.joinpath(default)
if resource.exists():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace unsupported importlib.resources exists check

The new _collect_olivine_inputs() uses resources.files("spectrumpy_flight").joinpath(default) and then calls resource.exists(). Traversable objects returned by importlib.resources do not implement exists, so the test will raise an AttributeError before any assertions run. Use resource.is_dir()/is_file() or as_file instead of exists to keep the test runnable.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants