Skip to content

Code 2: Fix the error with Python >=3.9. Handle ruff and mypy#12

Merged
marcinmiklitz merged 11 commits intomarcinmiklitz:developmentfrom
andrewtarzia:code_2
Jul 28, 2025
Merged

Code 2: Fix the error with Python >=3.9. Handle ruff and mypy#12
marcinmiklitz merged 11 commits intomarcinmiklitz:developmentfrom
andrewtarzia:code_2

Conversation

@andrewtarzia
Copy link
Collaborator

Note that the tests that fail in test_molecular seem like genuine changes in the numerical rebuild process. I wonder if changing versions actually has altered some of the math slightly? Any insight @marcinmiklitz ?

I do not think it is possible to fix mypy issues without significant changes to the data handling in pywindow, which is not in my timeframe at the moment. So I have ignored many with inline ignores.

To see an example of new docs: https://pywindow2--2.org.readthedocs.build/en/2/

@marcinmiklitz
Copy link
Owner

Hey @andrewtarzia,

I went through the PR and nothing stands out to me.

The 3 tests that are failing, are you more familiar with the nature of the mismatch. If these failures indicate a completely different answer, or simply out of 2 similar choice the numerical errors shifted the balance towards the other?

I haven't dig particularly deep yet. How worried we are here?

@andrewtarzia
Copy link
Collaborator Author

Hey @marcinmiklitz,

I think I have "solved" the tests. Basically, I think some math changed in the coordinate and ordering in the supercell generation and molecule (make_modular) process between numpy versions. So, I have updated the outputs based on current version, and checked the molecules made sense (CC3!), and output the expected structures to files for visualisation because comparing chemistry was hard with those dictionaries.

Please review the last two commits of changes.

@marcinmiklitz
Copy link
Owner

Hey @marcinmiklitz,

I think I have "solved" the tests. Basically, I think some math changed in the coordinate and ordering in the supercell generation and molecule (make_modular) process between numpy versions. So, I have updated the outputs based on current version, and checked the molecules made sense (CC3!), and output the expected structures to files for visualisation because comparing chemistry was hard with those dictionaries.

Please review the last two commits of changes.

Hey @andrewtarzia, thanks for solving this! I think this is a sensible explanation and solution. We've only had couple tests affected, not all of them, so it gives confidence that the differences were very small, hopefully not affecting results where larger samples are considered. Thanks! Merging this now.

@marcinmiklitz marcinmiklitz merged commit 40a0b4f into marcinmiklitz:development Jul 28, 2025
5 checks passed
@andrewtarzia andrewtarzia deleted the code_2 branch July 29, 2025 09:40
marcinmiklitz added a commit that referenced this pull request Jul 29, 2025
* Add workflows - will fail.

* Bring in modern tooling (uv, pyproject.toml, justfile).

* Update to name pywindowx - although this may need to change to pywindow? Update ignore.

* Update min python version.

* Use ubuntu latest.

* Update env for docs.

* Delete unused docs, setup and write cleaner docs - will fail until reorganisation of code.

* Move to internal, has issues.

* Run ruff fix on save on all.

* Update import statements internally.

* Add periodic table.

* Add utility for examples (implemented later).

* Remove doc page.

* Remove autosummary docs until docs work.

* Add os import (temporary).

* Rename tests to standard for pytest.

* Ruff fix.

* Ruff fix.

* Update tests to handle new interface.

* Add example scripts - will not run currently.

* Add a shortened HISTORY file to make example less expensive.

* Code 2: Fix the error with Python >=3.9. Handle ruff and mypy (#12)

* Add example init.

* Handle interface, ruff and mypy.

* Handle interface, ruff and mypy - remove _Shape preliminary.

* Handle interface, ruff and mypy.

* Handle interface, ruff and mypy.

* Handle interface, ruff and mypy.

* Include output of successfully built docs.

* Handle mypy in docs.

* Add input and output files.

* Add input and output files to test rebuild and periodic handling.

* Add some temp output for visualisation upon failure.

---------

Co-authored-by: Marcin Miklitz <marcin.miklitz@gmail.com>
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