App restructure#10
Merged
Merged
Conversation
Consolidates all notebook widget logic (cells 3–10) into a single QuantUIApp class. Also adds None guard to optimizer.py calculate() to satisfy mypy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add stable AI assistant context and developer test artifacts. Introduces .github/copilot-instructions.md describing repo structure, architecture, constraints, and development guidance for QuantUI-local. Adds notebooks/_inspect_nb.py (notebook inspector) and a temporary notebooks/app_test.ipynb to exercise the QuantUIApp UI, plus a pre-FR012 backup notebook (molecule_computations.pre-fr012.ipynb). Streamlines/updates notebooks/molecule_computations.ipynb in preparation for the FR-012 app refactor. Update apptainer/quantui-local.def to run import checks for QuantUIApp during build/runtime. Add tests/test_app.py and update tests/test_pubchem.py to support the new test coverage.
- app.py: QuantUIApp with all widget logic (FR-012 Phase 1-4) - app.py: Errors now show clean card in Calculate tab; full traceback goes to Output tab and ~/.quantui/logs/error_log.txt - app.py: clear_output fires synchronously on Run click (not in thread) - app.py: Remove Dark Blue/Maroon themes (imperceptible hue shift) - pubchem.py: Fix missing 'from rdkit.Chem import Descriptors' import - environment.yml: Add rdkit>=2022.03.1 - tests/test_app.py: 38 new tests for QuantUIApp - notebooks/molecule_computations.ipynb: Collapsed to 3-cell launcher - apptainer/quantui-local.def: Add QuantUIApp import check - planning/: Full TODO/ planning layout
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures QuantUI-local by moving the notebook-implemented UI into a dedicated QuantUIApp class, tightening top-level API exposure, and updating dependencies/docs to support more robust molecule import and runtime behavior.
Changes:
- Introduces
quantui/app.pywith a self-containedQuantUIAppand updates the student notebook to be a thin launcher. - Improves dependency/import robustness (RDKit descriptor import, conditional availability flags) and adds an optimizer precondition check.
- Expands project documentation and updates container/build checks to validate the new app import.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_pubchem.py |
Skips a real-network RDKit-dependent test when RDKit isn’t installed. |
tests/test_app.py |
Adds a new test suite for QuantUIApp construction and core behaviors. |
quantui/pubchem.py |
Imports Descriptors directly and uses it for molecular weight metadata. |
quantui/optimizer.py |
Raises a clear error if the ASE calculator has no attached Atoms. |
quantui/app.py |
Adds the new application class (widgets, callbacks, dispatch, rendering). |
quantui/__init__.py |
Exposes QuantUIApp as a top-level import and imports it last. |
notebooks/molecule_computations.ipynb |
Replaces notebook logic with a thin QuantUIApp().display() launcher. |
notebooks/_inspect_nb.py |
Adds a small helper script to inspect notebook structure. |
local-setup/environment.yml |
Adds rdkit to the conda environment dependencies. |
apptainer/quantui-local.def |
Adds container build/test checks to ensure QuantUIApp imports. |
.github/copilot-instructions.md |
Adds comprehensive project context and development constraints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…rresponding backend is unavailable Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…uction never fails due to telemetry/logging I/O QuantUIApp.__init__ previously called _calc_log.log_event(...), which writes to ~/.quantui/logs/ and can raise OSError in read-only or sandboxed environments (including some CI runners). Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Move all display/rendering work back to the main thread (e.g., store the fetched molecule and schedule a UI update callback) and keep the background thread limited to pure data fetching/parsing. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…-thread-only rendering Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Collaborator
Author
|
@copilot Please fix the following lint failure: black....................................................................Failed
reformatted tests/test_app.py |
Agent-Logs-Url: https://github.com/The-Schultz-Lab/QuantUI-local/sessions/bf643eec-8667-4aba-90f5-68f761866167 Co-authored-by: NCCU-Schultz-Lab <230880974+NCCU-Schultz-Lab@users.noreply.github.com>
Contributor
Small cleanup across notebooks and package config: - notebooks/molecule_computations.ipynb: add minor whitespace, simplify a warning print (remove unnecessary f-string) and add a blank line before QuantUIApp().display(). - notebooks/tutorials/02_basis_set_study.ipynb: reorder and simplify imports (keep Molecule and parse_xyz_input grouped, swap/run SessionResult and run_in_session order) and add a separating blank line. - pyproject.toml: add UP045 to the ruff ignore list (allow using X | None instead of Optional[X]). - quantui/app.py: adjust import grouping/parentheses for pubchem imports to fix formatting. These are non-functional cleanups to improve readability and satisfy linting/style preferences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to project documentation, dependency management, and code robustness for the QuantUI-local project. The key changes include adding a comprehensive project context file for AI assistants, improving import safety and API exposure for the main app class, updating dependencies for molecule parsing, and enhancing error handling in geometry optimization. Additionally, minor build and test script updates were made to ensure the main app imports correctly.
Documentation and Project Context:
.github/copilot-instructions.mdfile describing the project's architecture, constraints, file structure, supported features, and development conventions, providing stable context for AI coding assistants and contributors.Dependency and Import Improvements:
rdkitas a required dependency inenvironment.ymlto support molecule parsing and PubChem integration.quantui/pubchem.pyto importDescriptorsdirectly fromrdkit.Chemand use it for molecular weight calculations, improving clarity and reliability. [1] [2] [3]API Exposure and Import Safety:
QuantUIAppimport to the end ofquantui/__init__.pyand added it to__all__, ensuring it's always available as a top-level import and preventing circular import issues. [1] [2]Robustness and Error Handling:
quantui/optimizer.pyto raise aRuntimeErrorif noAtomsobject is attached to the calculator before running geometry optimization, preventing obscure downstream errors.Build and Test Script Updates:
QuantUIAppimports successfully, ensuring container integrity. [1] [2]notebooks/_inspect_nb.pyutility script to inspect notebook structure for debugging or validation.