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

MAINT: Bugs and updates #131

Merged
merged 74 commits into from
Apr 5, 2024
Merged

MAINT: Bugs and updates #131

merged 74 commits into from
Apr 5, 2024

Conversation

aburrell
Copy link
Owner

@aburrell aburrell commented Mar 28, 2024

Description

Addresses several issues - #128, #126, and #109 - and also:

  • Finishes transition to pyproject.toml,
  • Updates GitHub Actions yamls,
  • Added a RTD yaml,
  • Addresses numpy DeprecationWarnings,
  • Addresses updates to pysat,
  • Reduces duplication in the unit tests, and
  • Improves docstrings in the unit tests.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Ran unit tests locally.

Test Configuration

  • Operating system: OS X Big Sur
  • Version number: Python 3.9
  • Any details about your local setup that are relevant: pysat 3.2.0

Checklist:

  • Make sure you are merging into the develop (not main) branch
  • My commits are formatted appropriately (following the SciPy/NumPy style)
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • Add a note to Changelog.rst, summarising the changes
  • Add yourself to AUTHORS.rst and .zenodo.json

aburrell added 30 commits March 25, 2024 09:40
Updated .gitignore file for Mac systems.
Updated deprecation warnings with a version, addressing issue #109.
Updated pyproject.toml and deprecated the setup.py file.
Added test dependencies to pyproject.toml and added version capts to pysat.
Added a CI test for the ocbpy Release Candidate.
Updated the CI tests by:
- updating the GitHub Actions versions,
- use the pyproject.toml for installation,
- add a new python test version, and
- change the configuration file to pyproject.toml.
Update the package init file to obtain the version number from the pyproject.toml file.
Update the boundary directory discovery to use pathlib, since resources do not support directories.
Add a data catch for reading SuperMAG files without data and fix the docstring to reflect the correct outputs.
Added a docstring to the test init file.
Created a common class for logging tests and defined the test data directory as a variable.
Simplified vorticity tests by using common classes and variables.
Simplified SuperMAG tests by using common classes and variables.
Addressed a deprecation warning in the evaluation.
Reduced duplicate code and added checks by:
- ensuring `max_sdiff` is always an integer,
- specifying keys instead of accessing them impicitly,
- using descriptive variables in evaluations,
- reducing the number of loops by removing duplicate times from time index cycle,
- added a function to pad and flatten data, and
- combined similar processing loops.
Updated pysat unit tests by:
- using common testing classes and variables,
- updating instruments and load flags for upcoming pysat release, and
- combined similar unit tests using subTest.
Updated the time unit test docstring formats.
Updated the scaling unit tests to use the common testing classes and variables.
Fixed bug in shape tests that prevented indexes and single values being evaluated correctly.
Fixed bug in common class calls and added the test_dir variable to more places.
Updated the general tests to use the common test class and variable.
pathlib behaves differently, added more checks to ensure correct behaviour.
Updated the files tests to use common classes and variables.
Use the appropriate unittest method for evaluating strings.
Updated the DMSP SSJ unit tests to use the common test class and variable.
Fixed file clean up for a test and re-combined logging tests after debugging.
Removed an unused import.
Ensure archive filename can be found whether or not it was freshly downloaded to the desired location.
Update the cycle unit tests to use the common test class and variable.
Updated the boundary tests to use the common classes and variables.  Also updated behaviour to remove numpy deprecation warnings.
Try using the universal coveralls reporter.
@aburrell
Copy link
Owner Author

The GitHub Actions coveralls app was not useful because:

  • it didn't work on MacOS
  • it counted docstrings as uncovered lines
  • it counted else lines (that were accessed) as uncovered lines

aburrell added 17 commits March 29, 2024 13:07
The requests package is called explicitly in the DMSP SSJ unit tests.
Fix the yaml if statements to evaluate correctly.
Fix a different yaml bug.
MacOS is failing because it needs a token, create a yaml to store the token.
Fixed security leak for Coveralls.
Fixed token bug and windows execution bug.
Fix the windows coveralls command attempt 2.
Removed tab from yaml.
Windows is supposed to have tar from 2017 on, so this may work.
Use the windows snippet from the coverage reporter README instead of the example that isn't working.
Update main.yml for parallel coverage builds.
Removed an unnecessary download of coveralls reporter.
Improve the coveralls call by:
- moving the installation up top,
- using the parallel flag, and
- explicitly declare the repo token.
Different OS versions have different executable names, and so require different commands.
Removed the old code block that didn't work.
Fixed the final coveralls call to use the linux standard.
Finish requires coveralls to be downloaded again.
@aburrell
Copy link
Owner Author

aburrell commented Apr 3, 2024

coveralls coverage report still differs from local coverage report by 11% due to:

  • some docstrings
  • some second lines in logic statements
  • some “else” lines from if/else commands where both outcomes are covered.

aburrell added 7 commits April 4, 2024 11:47
Update .gitignore to include the xml coverage output.
Coveralls-reported does a better job with xml output.
Added coveralls update to the changelog.
Removed tabs from the yaml.
Specify the coverage XML file instead of a general format.
Try adding build number through the GA `run_number` variable to the done call.
Try declaring the build-number across the board, to ensure it matches.
@aburrell aburrell merged commit 24f1bd9 into develop Apr 5, 2024
87 checks passed
@aburrell aburrell deleted the bug_and_updates branch April 5, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants