From 41a39533157a8388c1505ab12f429e86338c8d21 Mon Sep 17 00:00:00 2001 From: Keenan Wyatt Date: Mon, 11 May 2026 10:33:35 -0700 Subject: [PATCH 1/3] Avoid launch failure from FullRMC constraint import --- src/saxshell/fullrmc/__init__.py | 46 +++++++++++++++---- src/saxshell/fullrmc/constraint_generation.py | 18 +++++++- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/saxshell/fullrmc/__init__.py b/src/saxshell/fullrmc/__init__.py index 75e821b..42d8072 100644 --- a/src/saxshell/fullrmc/__init__.py +++ b/src/saxshell/fullrmc/__init__.py @@ -2,14 +2,6 @@ from typing import TYPE_CHECKING -from .constraint_generation import ( - ConstraintGenerationEntry, - ConstraintGenerationMetadata, - ConstraintGenerationSettings, - build_constraint_generation, - load_constraint_generation_metadata, - save_constraint_generation_metadata, -) from .packmol_docker import ( DEFAULT_PACKMOL_CONTAINER_ROOT, PackmolDockerClient, @@ -112,6 +104,14 @@ ) if TYPE_CHECKING: + from .constraint_generation import ( + ConstraintGenerationEntry, + ConstraintGenerationMetadata, + ConstraintGenerationSettings, + build_constraint_generation, + load_constraint_generation_metadata, + save_constraint_generation_metadata, + ) from .ui.main_window import RMCSetupMainWindow, launch_rmcsetup_ui from .ui.representative_preview_window import RepresentativePreviewWindow from .ui.solvent_shell_builder_window import ( @@ -215,6 +215,36 @@ def __getattr__(name: str): + if name in { + "ConstraintGenerationEntry", + "ConstraintGenerationMetadata", + "ConstraintGenerationSettings", + "build_constraint_generation", + "load_constraint_generation_metadata", + "save_constraint_generation_metadata", + }: + from .constraint_generation import ( + ConstraintGenerationEntry, + ConstraintGenerationMetadata, + ConstraintGenerationSettings, + build_constraint_generation, + load_constraint_generation_metadata, + save_constraint_generation_metadata, + ) + + exports = { + "ConstraintGenerationEntry": ConstraintGenerationEntry, + "ConstraintGenerationMetadata": ConstraintGenerationMetadata, + "ConstraintGenerationSettings": ConstraintGenerationSettings, + "build_constraint_generation": build_constraint_generation, + "load_constraint_generation_metadata": ( + load_constraint_generation_metadata + ), + "save_constraint_generation_metadata": ( + save_constraint_generation_metadata + ), + } + return exports[name] if name in {"RMCSetupMainWindow", "launch_rmcsetup_ui"}: from .ui.main_window import RMCSetupMainWindow, launch_rmcsetup_ui diff --git a/src/saxshell/fullrmc/constraint_generation.py b/src/saxshell/fullrmc/constraint_generation.py index 4ed2af6..9232b84 100644 --- a/src/saxshell/fullrmc/constraint_generation.py +++ b/src/saxshell/fullrmc/constraint_generation.py @@ -6,7 +6,14 @@ from datetime import datetime from pathlib import Path -from saxshell.fullrmc._deprecated.constraintpdb import ConstraintPDB +try: + from saxshell.fullrmc._deprecated.constraintpdb import ConstraintPDB +except ModuleNotFoundError as exc: + ConstraintPDB = None # type: ignore[assignment] + _CONSTRAINTPDB_IMPORT_ERROR = exc +else: + _CONSTRAINTPDB_IMPORT_ERROR = None + from saxshell.fullrmc.packmol_setup import PackmolSetupMetadata if False: # pragma: no cover @@ -170,6 +177,15 @@ def build_constraint_generation( merged_bond_angles: dict[str, list[list[object]]] = {} entries: list[ConstraintGenerationEntry] = [] + if ConstraintPDB is None: + raise RuntimeError( + "Constraint generation requires ConstraintPDB, but " + "saxshell.fullrmc._deprecated.constraintpdb could not be " + "imported. Restore the missing module or update " + "constraint_generation.py to use the current ConstraintPDB " + "implementation." + ) from _CONSTRAINTPDB_IMPORT_ERROR + for setup_entry in active_setup.entries: pdb_path = Path(setup_entry.packmol_pdb).expanduser().resolve() if not pdb_path.is_file(): From 6481fea6808fe2e82b38c7acdb7bf237cb686eeb Mon Sep 17 00:00:00 2001 From: Keenan Wyatt Date: Wed, 13 May 2026 09:22:47 -0700 Subject: [PATCH 2/3] Add Windows conda and launch instructions --- docs/getting-started/installation.md | 61 +++++++++++++++++++++++++++- requirements/saxshell-py312-win.yml | 47 +++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 requirements/saxshell-py312-win.yml diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 790bca1..206ba4f 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -27,8 +27,25 @@ Create the environment from the checked-in `.yml` file: conda env create -f requirements/saxshell-py312.yml ``` +### Windows users + +On native Windows, create the environment from the Windows-specific environment +file: + +```cmd +conda env create -f requirements\saxshell-py312-win.yml +``` + If the environment already exists, update it from the same file: +```cmd +conda env update -n saxshell-py312 -f requirements\saxshell-py312-win.yml --prune +``` + +### Linux, macOS, and WSL users + +If the environment already exists, update it from the default environment file: + ```bash conda env update -n saxshell-py312 -f requirements/saxshell-py312.yml --prune ``` @@ -38,16 +55,58 @@ logs and tracebacks remain visible in the terminal. ## Launch SAXSShell -Start the main SAXSShell application from the repository root: +Start the main SAXSShell application from the repository root. + +### Linux, macOS, and WSL users ```bash PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs ``` +### Windows users + +There are two supported launch methods depending on whether you are using +Anaconda Prompt or Windows PowerShell. + +#### From Anaconda Prompt + +Activate the environment, set `PYTHONPATH`, and launch the SAXS UI: + +```cmd +conda activate saxshell-py312 +set PYTHONPATH=src +python -m saxshell.saxs +``` + +You can also launch without activating the environment: + +```cmd +set PYTHONPATH=src +conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs +``` + +#### From Windows PowerShell + +Set `PYTHONPATH` using PowerShell syntax, then launch through `conda run`: + +```powershell +$env:PYTHONPATH = "src" +conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs +``` + +If your PowerShell session is configured for conda activation, this also works: + +```powershell +conda activate saxshell-py312 +$env:PYTHONPATH = "src" +python -m saxshell.saxs +``` + The application opens to the main SAXS workflow. Create or select a dedicated project folder in **Project Setup** after your trajectory-derived frames and clusters are ready. + ## Recommended starting point Before spending time in Prefit or DREAM, prepare the simulation data that the diff --git a/requirements/saxshell-py312-win.yml b/requirements/saxshell-py312-win.yml new file mode 100644 index 0000000..eb8c66d --- /dev/null +++ b/requirements/saxshell-py312-win.yml @@ -0,0 +1,47 @@ +name: saxshell-py312 +channels: + - conda-forge + - defaults +channel_priority: strict +dependencies: + # Core runtime + - python=3.12 + - pip + - numpy + - scipy + - pandas + - matplotlib + - lmfit + - uncertainties + - networkx + - pyyaml + - requests + + # Data / file formats / parallel workflow support + - xarray + - dask + - distributed + - netcdf4 + - h5py + - pyarrow + - bottleneck + + # Qt GUI stack for Windows + - pyside6 + - qtpy + - pyqtgraph + + # Interactive/dev tooling + - ipython + - ipykernel + - jupyterlab + - pytest + - pytest-cov + - coverage + - pre-commit + - mypy + + # Pip-only / project-specific packages + - pip: + - pydream + - xraydb>=4.5.8 From 5805f0bfe79e90c417e6daf6552e0801b2f7f264 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 16:27:40 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit hooks --- docs/getting-started/installation.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 206ba4f..79996e9 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -106,7 +106,6 @@ The application opens to the main SAXS workflow. Create or select a dedicated project folder in **Project Setup** after your trajectory-derived frames and clusters are ready. - ## Recommended starting point Before spending time in Prefit or DREAM, prepare the simulation data that the