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

Add additional functions to pyxx.arrays #17

Merged
merged 10 commits into from
Sep 24, 2022
Merged

Add additional functions to pyxx.arrays #17

merged 10 commits into from
Sep 24, 2022

Conversation

nathan-hess
Copy link
Owner

@nathan-hess nathan-hess commented Sep 24, 2022

Major Changes and Improvements

  • Added new functions to pyxx.arrays module, and added tests and documentation for all new code
    • pyxx.arrays.check_len_equal() and pyxx.arrays.is_len_equal() compare lengths of input arrays or other objects
    • pyxx.arrays.is_array_equal() checks whether multiple arrays have the same size and content (within a given tolerance for numeric content)
  • Added new context manager to Python test code that can capture text printed by running code (useful for testing that desired content is printed)

Bug Fixes

  • Changed format of package version number in pyxx/__init__.py to use string instead of f-string
    • See reference links below. It appears that setuptools requires specific syntax for reading attributes from a file, and the previous f-string did not function as expected. One possibility (although it would require more debugging to determine) is that setuptools was attempting to read the f-string statically and obtaining unexpected results.

Minor Updates

  • Reorganized documentation files
  • Added missing test for pyxx.files.File class

Notes and References

Added a new function to `pyxx.arrays` to check whether an arbitrary number of sequence-type objects (lists, tuples, and/or strings) have equal length. Added tests for new code
Added new function `pyxx.arrays.np_array_equal()` to check equality (shape and values) of numeric NumPy arrays. Also added tests and documentation for this function
…e equal length

Added new function that provides the same functionality as `pyxx.arrays.check_len_equal()` but returns only a True/False output and offers a slight performance improvement in certain cases
@nathan-hess nathan-hess added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file testing Additions or updates to automated unit and regression tests labels Sep 24, 2022
@nathan-hess nathan-hess self-assigned this Sep 24, 2022
…xx.arrays.is_array_equal()` function

Rewrote array equality function to make it more general, capable of comparing a wider variety of arrays
Revised function logic so that it is capable of handling a wider variety of input types
@nathan-hess nathan-hess merged commit 269b0ca into main Sep 24, 2022
@nathan-hess nathan-hess deleted the add-array-tools branch September 24, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request testing Additions or updates to automated unit and regression tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant