Repository navigation
Saxs model - #51
Saxs model#51
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2e1fa1cc0
ℹ️ 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".
| for widget in ( | ||
| self.load_input_button, | ||
| self.run_button, | ||
| self.update_mesh_button, |
There was a problem hiding this comment.
Prevent input reloads while worker thread is active
The busy-state toggle disables load_input_button/input_path_edit but not the file/folder browse actions, so users can still trigger _load_input_from_edit() during an active background run. In that case self._inspection and self._structure can be replaced mid-calculation, and when the old worker finishes its result is applied to a different UI context, which can silently mix outputs and displayed metadata.
Useful? React with 👍 / 👎.
| counts = { | ||
| str(element): int(float(amount)) | ||
| for element, amount in parsed.items() | ||
| if float(amount) > 0.0 |
There was a problem hiding this comment.
Preserve fractional stoichiometry when parsing solvent formula
This conversion truncates parsed stoichiometric coefficients to integers (int(float(amount))), so valid fractional formulas (which xraydb.chemparse can return) are miscomputed or even zeroed out. That directly biases formula_electrons/formula_mass, producing incorrect solvent electron-density estimates for custom solvents with non-integer composition.
Useful? React with 👍 / 👎.
Summary
This PR adds a new Electron Density Mapping supporting application to SAXSShell, wires it into the main SAXS UI Tools menu, includes focused UI stability/layout fixes, and adds a planning note for the upcoming Born-approximation workflow.
Scope of this comment: commits
62d1bbathroughf18e31b(4 commits, 14 files changed, 8625 insertions, 1 deletion).What Changed
src/saxshell/saxs/electron_density_mapping/.xyz/.pdb)docs/user-guide/electron-density-mapping.mdmkdocs.yml)docs/planned_updates/bornapprox.txtwith Born Approximation implementation plan and UI/data-flow requirementsTests / Validation
tests/test_electron_density_mapping.pycovering workflow and UI behavior.tests/test_saxs_ui.pyfor menu action visibility and launch context behavior.PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 pytest tests/test_electron_density_mapping.py tests/test_saxs_ui.py -k "electron_density_mapping_tool_uses_active_structure_folder or menus_expose_project_tools_and_help"(passed)PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 pytest tests/test_electron_density_mapping.py -k "inspect_structure_input_handles_single_files_and_folders or load_electron_density_structure_uses_mass_weighted_center_of_mass"(passed)Reviewer Notes
Tools -> Open Electron Density Mappingsrc/saxshell/saxs/ui/main_window.pysaxs/electron_density_mapping, with explicit tests and docs included.Follow-up
docs/planned_updates/bornapprox.txtand are not fully implemented in this PR.