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

Package upgrades #159

Merged
merged 5 commits into from
Nov 5, 2024
Merged

Package upgrades #159

merged 5 commits into from
Nov 5, 2024

Conversation

KyleQianliMa
Copy link

@KyleQianliMa KyleQianliMa commented Oct 31, 2024

Short description of the changes:

Upgraded every packages to latest version except pyre.

Fixed the deprecated interp2d function in scipy.
Implemented a custom function to upgrade imp module
Made sure python version is > 3.10
Kept getdos method with upgraded scipy version
deprecated ui/getdos.py since this is not in tests and once ipywe is remvoed this is no longer functioning
Removed ipywe and removed related tests that import ipywe.

ui/getdos.py is deprecated (renamed to ui/getdos_deprecated.py). This algorithm fails with the deletion of ipywe. This algorithm is also not covered in tests. Just in case users are using old jupyternotebooks that calls this algorithm, first, pip install ipywe then import multiphonon.ui.getdos_deprecated as (name).

Story 6599

Long description of the changes:

Check list for the pull request

  • I have read the [CONTRIBUTING]
  • I have read the [CODE_OF_CONDUCT]
  • I have added tests for my changes
  • I have updated the documentation accordingly

Check list for the reviewer

  • I have read the [CONTRIBUTING]
  • I have verified the proposed changes
  • best software practices
    • all internal functions have an underbar, as is python standard
    • clearly named variables (better to be verbose in variable names)
    • code comments explaining the intent of code blocks
  • All the tests are passing
  • The documentation is up to date
  • code comments added when explaining intent

Manual test for the reviewer

To test, git pull this branch, run pytest make sure all tests pass. Check version numbers for numpy, scipy, python, mantid, matplotlib should all be latest version

References

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.26%. Comparing base (fd555f9) to head (f1c76b8).

Additional details and impacted files
@@             Coverage Diff             @@
##             next     #159       +/-   ##
===========================================
- Coverage   89.03%   76.26%   -12.77%     
===========================================
  Files          23       23               
  Lines        1395     1403        +8     
===========================================
- Hits         1242     1070      -172     
- Misses        153      333      +180     

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

@KyleQianliMa KyleQianliMa changed the base branch from next to main November 4, 2024 16:47
@KyleQianliMa KyleQianliMa changed the base branch from main to next November 4, 2024 16:47
deprecate ipywe module

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

scipy upgrades, imp module update
@mpatrou
Copy link
Collaborator

mpatrou commented Nov 4, 2024

dataurls = imp.load_source("dataurls", os.path.join(datadir, "dataurls.py"))


def load_source(modname, filename):
Copy link
Collaborator

@mpatrou mpatrou Nov 4, 2024

Choose a reason for hiding this comment

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

the load_source function looks the same as above. It can be included in one spot and imported everywhere.

Copy link
Author

Choose a reason for hiding this comment

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

These have been fixed. The load_source function is now in multiphonon.sqe.init.py

@mpatrou
Copy link
Collaborator

mpatrou commented Nov 4, 2024

there are various warnings, when running pytest: "/multiphonon/backward/stitch_dos.py:100: UserWarning: Scaling factor to combine DOSes calculated is not stable:" Is this expected?

@mpatrou
Copy link
Collaborator

mpatrou commented Nov 4, 2024

What about this one ?:
"multiphonon/backward/plotutils.py:75: MatplotlibDeprecationWarning: Auto-removal of overlapping axes is deprecated since 3.6 and will be removed two minor releases later; explicitly call ax.remove() as needed.
plt.subplot(3, 3, index + 1)"

@@ -1,4 +1,8 @@
# -*- python -*-
# This algorithm should be deprecated with the deletion of ipywe. This algorithm is not covered in tests.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you include in your PR summary how to import this to have it as a reference, please?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, there is an added instructions now

@KyleQianliMa
Copy link
Author

The warnings are expected. The matplotlib depreactation warning may produce errors in the future. A new ticket should be created to capture it or address when it happens.

Copy link
Collaborator

@mpatrou mpatrou left a comment

Choose a reason for hiding this comment

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

It looks good to me!

@KyleQianliMa KyleQianliMa merged commit 8c5e8ed into next Nov 5, 2024
4 checks passed
@KyleQianliMa KyleQianliMa deleted the package_upgrades branch November 5, 2024 20:15
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.

3 participants