Skip to content

Post-processing: Support for the 'threads' output file format#245

Merged
Ed Hone (EdHone) merged 5 commits intoMetOffice:mainfrom
EdHone:py-vernier-threadsfile
Apr 14, 2026
Merged

Post-processing: Support for the 'threads' output file format#245
Ed Hone (EdHone) merged 5 commits intoMetOffice:mainfrom
EdHone:py-vernier-threadsfile

Conversation

@EdHone
Copy link
Copy Markdown
Collaborator

@EdHone Ed Hone (EdHone) commented Apr 10, 2026

Description

This PR introduces parsing functionality for the alternative 'threads' vernier output format. New test data has been introduced for the new format and the data has been reorganised to reflect the differences between the data. New tests have been added for the new read functionality.

There has also been a slightly change to the CLI script to correct the path setting to enable running of the unit-tests without installing the package first.

Linked issues

Closes #243

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • New tests have been added
  • Tests have been modified to accommodate this change

Checklist:

  • My code follows the style guidelines of this project
  • 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, for both debug and optimised builds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Ed, this looks like a good change. Just a couple things to address regarding documentation and adding a test.

Comment on lines +118 to +122
def _parse_drhook_data(self, file_contents) -> VernierData:
"""
Parses the contents of a Vernier output file in the 'drhook' format
into a VernierData object.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add parameter and returns to docstring.

Comment on lines +54 to +58
def _parse_threadsfile_data(self, file_contents) -> VernierData:
"""
Parses the contents of a Vernier output file in the 'threads' format
into a VernierData object.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add parameter and returns to docstring.

Comment on lines 39 to 45
def _get_file_format(self, file_header) -> VernierFileFormat:
"""
Loads Vernier data from a single file, and returns it as a VernierData
object.
Determines file format based on file contents - looks for the presence
of characteristic string fragments in a provided section of the file
contents.

"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add parameter and returns to docstring.

Comment thread post-processing/tests/test_vernier_reader.py
Comment thread post-processing/vernier/lib/vernier_reader.py
Comment thread post-processing/vernier/lib/vernier_reader.py
Comment thread post-processing/vernier/lib/vernier_reader.py
@EdHone
Copy link
Copy Markdown
Collaborator Author

Ed Hone (EdHone) commented Apr 14, 2026

Thanks Oakley Brunt (@oakleybrunt) - I believe I have addressed your comments in my latest upcoming commit. Back to you :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Ed, happy to approve now

@EdHone Ed Hone (EdHone) merged commit 59a323d into MetOffice:main Apr 14, 2026
12 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.

[Custom Issue]: Post-processing - Implement loading for 'threads' file type

2 participants