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

corrected import of function to compute trapezoidal sum from scipy.in… #244

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

connor-krill
Copy link
Contributor

Bug fix: Corrected import from SciPy

There is a broken import statement trying to call a legacy SciPy 0.10.1 function. The import statement and function call were corrected to the appropriate function call in SciPy 1.14.1.

Description

Old versions of SciPy (starting with 0.10.1) used a function called trapz to compute an integral using the trapezoidal rule. SciPy 1.14.1 calls this function trapezoid. The import statement and function call were corrected to trapezoid for compatibility with SciPy 1.14.1.

SciPy 0.10.1 trapz documentation
SciPy 1.14.1 trapezoid documentation

Related Issue

Correcting issue #242

Motivation and Context

The faulty import statement prevents UQpy from importing

How Has This Been Tested?

The faulty import statements prevented UQpy from important in a newly created virtual environment created using conda, running Python 3.10 and installed via pip install UQpy. In addition to the original issue, this bug was recreated on two separate MacBook Pros running Sonoma MacOS.

The offending import statement was found in ParallelTemperatingMCMC.py, which has two tests (test_parallel and test_thermodynamic_regulation) in test_temperting.py. Both tests pass after the import statement and relevant function calls were corrected.

Screenshots (if appropriate):

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@connor-krill connor-krill self-assigned this Sep 9, 2024
Copy link

@dimtsap dimtsap merged commit 93c2e63 into Development Sep 13, 2024
4 checks passed
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