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

ENH/BUG: Filename fix for #1173 #1174

Merged
merged 11 commits into from
Feb 2, 2024
Merged

ENH/BUG: Filename fix for #1173 #1174

merged 11 commits into from
Feb 2, 2024

Conversation

aburrell
Copy link
Member

@aburrell aburrell commented Jan 30, 2024

Description

Addresses #1173 by introducing consideration of supplied type when parsing filename formats.

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 using a modified example from the test case:

import pysat
files = ["jro20230417drifts.001.hdf5”, “jro20230417drifts.txt.hdf5"]
format_str = "jro{year:04d}{month:02d}{day:02d}drifts.{version:03d}.hdf5"
pysat.utils.files.parse_fixed_width_filenames(files, format_str)

The output should not have the second file in files as a viable output file.

Test Configuration:

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

Checklist:

  • [N/A] Make sure you are merging into the develop (not main) branch
  • 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.md, summarizing the changes

If this is a release PR, replace the first item of the above checklist with the release
checklist on the wiki: https://github.com/pysat/pysat/wiki/Checklist-for-Release

Adding type to file formatting.
Added the ability for pysat to identify files that shouldn't be considered based on the expected value type of the identifying key.
Fixed index use in `parse_delimited_filenames`.
Updated the file tests to include the new dict output and test for bad file removal by index.
Fixed another instance of the wrong index.
Removed old line from header.
Set the default type for time parameters to be int, if none is supplied.
Test file removal by bad format specifier.
Removed extra whitespace.
Updated the changelog.
@aburrell aburrell added this to the 3.2.0 Release milestone Jan 30, 2024
@aburrell aburrell added the bug label Jan 30, 2024
@aburrell aburrell linked an issue Jan 30, 2024 that may be closed by this pull request
@aburrell
Copy link
Member Author

Coverage drop appears to be a rounding error.

Remove a clean flag that stand in the way of this test passing.
@aburrell aburrell mentioned this pull request Feb 1, 2024
25 tasks
@aburrell aburrell merged commit 4f4f955 into rc_3_2_0 Feb 2, 2024
21 of 23 checks passed
@aburrell aburrell deleted the filename_fix branch February 2, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming convention for tag "version"
2 participants