Optimization - #1
Open
Ajax23 wants to merge 19 commits into
Open
Conversation
Code quality: - construct.py: extracted _write_positions helper (NumPy array → GROMACS position file) and _gmx_insert_cmd helper (centralises insert-molecules command building with optional -dr/-ip flags), replacing duplicated inline logic - actuate.py: shared folder/file path constants extracted from method-local variables to Actuate instance attributes; removes unused 're.A' import - simulate.py: Jinja2 analysis-script rendering refactored — single mol-metadata loop, has_fill derived once, template selection unified - Template scripts trimmed; dead sort.py template removed - tests/data/forhlr.sh: GROMACS module updated to 2024.3; GPU gres line added Tests: - Migrated test_simple.py (unittest) to pytest; split into test_unit.py and test_integration.py; new unit tests for Box API, Construct helpers Documentation: - docsrc/ RST sources migrated to MyST Markdown under docs/ - Sphinx theme updated to furo; sphinx-autoapi for API docs - Built HTML preserved under docs/v_old/ CI / tooling: - Added ruff lint and pip-audit security workflows - CI matrix extended to Python 3.10–3.13 Administrative: - setup.py: version 1.0.0, python_requires >=3.10, jinja2 unpinned
Drop Python 3.10 and 3.11 from CI matrix and classifiers; raise python_requires to >=3.12 in setup.py; update README and changelog.
Replace setup.py and MANIFEST.in with a single pyproject.toml; package-data absorbed into [tool.setuptools.package-data].
Switch all workflows from pip to uv (astral-sh/setup-uv@v5) for faster installs; remove requirements.txt (deps now declared solely in pyproject.toml); add explicit [tool.ruff] config to pyproject.toml.
Declare pytest and pytest-cov under [project.optional-dependencies] dev so the full test environment is installed with: pip install -e ".[dev]" CI updated to use the same extras group.
Replace manual venv setup with the dev install step so the README reflects the current pyproject.toml optional-dependencies setup.
Administrative section now reflects pyproject.toml and the new [project.optional-dependencies] dev group.
- Replace mutable defaults (area=[], box=[], kwargs_gmx={}) in add_mol
with None sentinels to prevent cross-call state sharing
- Modernize super(Benchmark, self).__init__() to bare super().__init__()
- Add encoding="utf-8" to all text-mode open() calls in analyze.py and
construct.py for cross-platform correctness
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
- Remove tracked docs/v_old/ build snapshot (233 files); users should install the matching package version to get old docs - Remove cp -r v_old post-build hook from docs/Makefile - Remove v_old copy step from CI workflow - Enable MyST colon_fence extension so :::directives render correctly - Add _templates/base.html to default furo theme to light mode - Add custom style.css with brand colours (#c8860a) and dark-mode image fix (white background on transparent plots) - Wire templates_path, html_css_files, and myst_enable_extensions into conf.py - Clean up index.md: remove logo figure, remove v_old note, fix autoapi/index.html internal link suffix - Add docs/autoapi/ and docs/generated/ to .gitignore
- Convert docs/pics/pore_il.pdf and 2phase_il.pdf to SVG so images render in browsers (PDF is not supported as an <img> src in HTML) - Update simulation_complex.md and simulation_2ph.md figure directives to reference .svg files - Remove explicit width/height="100%" from logo_text.svg so furo can scale it by viewBox aspect ratio without clipping the top
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.
v1.0.0
Code quality
construct.py— extracted_write_positions(path, positions)helper: writes an (N, 3) NumPy position array to a GROMACS position file, replacing repeated inline loops; used for all molecule-insertion position filesconstruct.py— extracted_gmx_insert_cmd(folder_gro, file_box, mol, nmol, dr, pos_file)helper: centralises GROMACSinsert-moleculescommand construction with optional-drand-ipflags, eliminating duplicated string-building across pore/box/slit code pathsactuate.py— shared folder/file path constants (_gro/,_top/,_mdp/,box.gro,topol.top,index.ndx) extracted from local variables in each method to instance attributes onActuate.__init__; both_equilibrationand_simulationmethods now referenceself._folder_*/self._file_*actuate.py— removed unusedfrom re import Aimportsimulate.py— Jinja2 template rendering for analysis scripts (auto_dens.py/auto_dens_box.py) refactored: molecule metadata collected into a singlejinja2_dictloop;has_fillflag derived once instead of re-evaluated; template selection unified in a single branchauto_dens.pyandauto_dens_box.pytrimmed;sort.pytemplate removed (dead code)tests/data/forhlr.sh— GROMACS module updated from 2016.5 to 2024.3;#SBATCH --gresline added for GPU node supportTests
tests/test_simple.pyfrom unittest to pytesttest_unit.py(fast, no file I/O) andtest_integration.py(full output generation)test_unit.py— new unit tests:Boxgetter/setter round-trips,add_molvalidation,add_topolall types,Construct._write_positionsbyte-level output,Construct._gmx_insert_cmdall flag combinationsDocumentation
docsrc/todocs/; previous built HTML preserved atdocs/v_old/CI / tooling
lint.yml)security.yml)python_requiresbumped to>=3.12setup.py+MANIFEST.into a singlepyproject.toml(PEP 517/621);[tool.ruff]config addedpiptouv(astral-sh/setup-uv@v5);requirements.txtremoved (deps resolved viapyproject.toml)Administrative
pyproject.toml: version 1.0.0,requires-python = ">=3.12", author email updated, jinja2 unpinned;[project.optional-dependencies]dev group added (pytest,pytest-cov)