Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

30 update codebase to work with Python 3.8 (and thus ase v3.23) #163

Merged
merged 80 commits into from
Aug 2, 2024

Conversation

logsdail
Copy link
Owner

@logsdail logsdail commented Jun 3, 2024

Testing to updated codebase with ASE release

Update the yaml files so now we are testing ASE v3.23.0.
v3.23.0 requires Python 3.8, so making this update.
@logsdail logsdail linked an issue Jun 3, 2024 that may be closed by this pull request
Backtracking, to test what behaviour we get with Python 3.7
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 97.93103% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.38%. Comparing base (5e7334c) to head (68e195b).

Files Patch % Lines
carmm/run/aims_calculator.py 94.11% 1 Missing ⚠️
examples/run_aims.py 66.66% 1 Missing ⚠️
examples/utils_python_env_check.py 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
+ Coverage   89.10%   89.38%   +0.27%     
==========================================
  Files          81       82       +1     
  Lines        3286     3382      +96     
==========================================
+ Hits         2928     3023      +95     
- Misses        358      359       +1     
Flag Coverage Δ
unittests 89.38% <97.93%> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@logsdail logsdail changed the title 30 update codebase to work with ase v323 30 update codebase to work with Python 3.8 (and thus ase v3.23) Jun 3, 2024
Changed to version Python 3.8 - should we go higher?
Changed to version Python 3.8 - should we go higher?
@logsdail
Copy link
Owner Author

logsdail commented Jun 3, 2024

Noting here that the docs runs with Python 3.9 - should we standardise to this version, perhaps?

@logsdail
Copy link
Owner Author

logsdail commented Jun 5, 2024

So I think after discussion today at a Group meeting, this has become an "update Python version to the most suitable for our HPC architectures".

Current Python compatibility of code: Python 3.7 (i.e., CI tests work to this version)

Current HPC system Python provisions:
Hawk: 3.7 (used currently, default), 3.9.2, 3.10.4, 3.11.2
Isambard: 3.7.3.2 (used currently), 3.8.5.1 (default)
Young: 3.6 (used currently), 3.7.0, 3.7.2, 3.7.4, 3.8.0, 3.8.6 (default), 3.9.0, 3.9.1, 3.9.6, 3.9.10, 3.11.3, 3.11.4
ARCHER2: 3.6.15 (used currently) 3.9.13.1 (default) 3.10.10

@logsdail
Copy link
Owner Author

logsdail commented Jun 5, 2024

So I think after discussion today at a Group meeting, this has become an "update Python version to the most suitable for our HPC architectures".

Current Python compatibility of code: Python 3.7 (i.e., CI tests work to this version)

Current HPC system Python provisions: Hawk: 3.7 (used currently, default), 3.9.2, 3.10.4, 3.11.2 Isambard: 3.7.3.2 (used currently), 3.8.5.1 (default) Young: 3.6 (used currently), 3.7.0, 3.7.2, 3.7.4, 3.8.0, 3.8.6 (default), 3.9.0, 3.9.1, 3.9.6, 3.9.10, 3.11.3, 3.11.4 ARCHER2: 3.6.15 (used currently) 3.9.13.1 (default) 3.10.10

My take home from this is the minimum we should go to is 3.8 or 3.9, but certainly not towards the high numbers.

Remove some redundant comments.
Added new file to just do Python 3.8 linter checks.
Revert existing Linter to Python 3.7, and name appropriately (so can check and errors arising)
Updated CI tests to run for Python 3.7 explicit. Will duplicate for Python 3.8 and Python 3.9
Added Python 3.8 check
Realised I can just do this with a version matrix.
Realised I can do this with a version matrix.
Setup linter to run over multple Python versions. Probably overkill but good testbed
Upgrade the CI tests (also has an action version update)
…ims interface, and when the test fails it doesn't revert to the correct directory. Requires some careful thinking how to resolve @GaryLZW
logsdail and others added 6 commits July 31, 2024 16:29
* Accommodate ase 3.23

* clean up some print statements

* Change assertion line due to change of input file style.
Write input files for 3.23 case

---------

Co-authored-by: Andrew Logsdail <LogsdailA@cardiff.ac.uk>
…:logsdail/carmm into 30-update-codebase-to-work-with-ase-v323
@logsdail
Copy link
Owner Author

logsdail commented Aug 1, 2024

@PavelStishenko as suggested I've put a tag on the mainline version, and once merged we'll bumpy the minor version number.

Copy link
Collaborator

@ikowalec ikowalec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some tidy up to do, but that is not related to the compatibility issues, which have been resolved successfully.

carmm/utils/python_env_check.py Show resolved Hide resolved
examples/analyse_counterpoise.py Outdated Show resolved Hide resolved
examples/analyse_forces.py Outdated Show resolved Hide resolved
.github/workflows/main.yml Show resolved Hide resolved
examples/analyse_counterpoise.py Show resolved Hide resolved
examples/build_symmetry_mirror.py Outdated Show resolved Hide resolved
carmm/utils/python_env_check.py Outdated Show resolved Hide resolved
carmm/run/workflows/react.py Outdated Show resolved Hide resolved
@ikowalec
Copy link
Collaborator

ikowalec commented Aug 1, 2024

I suggest a second review before merge.

@logsdail
Copy link
Owner Author

logsdail commented Aug 1, 2024

@ikowalec thanks for comments - all addressed. Does someone else want to do a second review, please?

@logsdail
Copy link
Owner Author

logsdail commented Aug 1, 2024

@GaryLZW I simplified the analyse_counterpoise test, as the checking for ASE now happens in get_aims_calculator. The CI tests pass but you might want to check if the code works correctly for further use cases.

@GaryLZW
Copy link
Collaborator

GaryLZW commented Aug 2, 2024

@GaryLZW I simplified the analyse_counterpoise test, as the checking for ASE now happens in get_aims_calculator. The CI tests pass but you might want to check if the code works correctly for further use cases.

This looks fine to me^^

@logsdail logsdail merged commit 08d248e into main Aug 2, 2024
6 checks passed
@FirasAssa
Copy link
Collaborator

During my project the following changes were made:
The err_handler folder was removed and a utils folder was created in its place
A python_env_check file was created with python_env_check() and is_env_python() inside
Implemented python_env_check() in anylyse_forces example
Implemented python_env_check() in analyse_calculator
Restricted mace-torch to 0.3.4, because it was failing on v3.7
Updated CatLearn to the most recent version to fix import error in mlneb.py, by getting the version of CatLearn directly from Git

Thinks still to do after the project:
In python v3.8 ci-test there are 4 places where .BadConfiguration Error occurs. Presumably it is the same type of problem that can be fixed in one go
Errors:
ERROR analyse_counterpoise.py - ase.calculators.calculator.BadConfiguration: No configuration of aims
ERROR run_aims.py - ase.calculators.calculator.BadConfiguration: No configuration of aims
ERROR run_workflows_ReactAims.py - ase.calculators.calculator.BadConfiguration: No configuration of aims
ERROR run_workflows_ReactAims_parallel.py - ase.calculators.calculator.BadConfiguration: No configuration of aims

@logsdail
Copy link
Owner Author

logsdail commented Aug 5, 2024 via email

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.

Update codebase to work with ASE v3.23
5 participants