Skip to content

feature: introduce config file for JPK tags#124

Merged
ns-rse merged 2 commits intomainfrom
ns-rse/119-parametrise-jpk-in-config
Mar 20, 2025
Merged

feature: introduce config file for JPK tags#124
ns-rse merged 2 commits intomainfrom
ns-rse/119-parametrise-jpk-in-config

Conversation

@ns-rse
Copy link
Copy Markdown
Collaborator

@ns-rse ns-rse commented Mar 18, 2025

Off the back of #118 (thanks @derollins) I've parameterised the JPK tags that were introduced into
AFMReader/default_config.yaml and load these by default when using AFMReader.load_jpk(). A parameter is introduced
to that function (confi_path) which allows users to specify their own configuration file should they wish to use alternative tags.

  • Copies the read_yaml() function and tests from TopoStats.
  • Brief description of configuration file and structure added to docs/usage.md (where some tables were also aligned by
    Emacs).

Exiting tests/test_jpk.py pass.

I envisage this being an extensible and flexible way of users being able to handle parameters changing the array of file types that
exist now and in the future and it should be easy to extend to other file formats.

@ns-rse ns-rse added the jpk label Mar 18, 2025
@ns-rse ns-rse force-pushed the ns-rse/119-parametrise-jpk-in-config branch 2 times, most recently from 68fe483 to fd1dbca Compare March 18, 2025 09:37
Off the back of #118 (thanks @derollins) I've parameterised the JPK tags that were introduced into
`AFMReader/default_config.yaml` and load these by default when using `AFMReader.load_jpl()`. A parameter is introduced
to that function which allows users to specify their own configuration file should they wish to use alternative tags.

- Copies the `read_yaml()` function and tests from TopoStats.
- Brief description of configuration file and structure added to `docs/usage.md` (where some tables were also aligned by
  Emacs).

Exiting `tests/test_jpk.py` pass.
@ns-rse ns-rse force-pushed the ns-rse/119-parametrise-jpk-in-config branch from fd1dbca to 6d7748a Compare March 18, 2025 09:40
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 18, 2025

Codecov Report

❌ Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.74%. Comparing base (ac9753c) to head (5a5674b).
⚠️ Report is 248 commits behind head on main.

Files with missing lines Patch % Lines
AFMReader/io.py 72.72% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
+ Coverage   74.62%   75.74%   +1.11%     
==========================================
  Files           8        9       +1     
  Lines         607      705      +98     
==========================================
+ Hits          453      534      +81     
- Misses        154      171      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@derollins derollins left a comment

Choose a reason for hiding this comment

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

Only suggestion is to add an extra value for completeness, have done it myself locally but don't know if I can change it here.

Comment thread AFMReader/default_config.yaml
Comment thread AFMReader/jpk.py Outdated
Comment thread docs/usage.md
@ns-rse
Copy link
Copy Markdown
Collaborator Author

ns-rse commented Mar 19, 2025

Brilliant, thanks for the feedback @derollins 👍

I've added in slot_size to the configuration file, updated AFMReader/jpk.py to use this parameter and included it in the documentation.

@ns-rse ns-rse requested a review from derollins March 19, 2025 09:28
Copy link
Copy Markdown
Member

@derollins derollins left a comment

Choose a reason for hiding this comment

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

Captures all the .jpk file tags used to read the files and has a clear config file for the values of these tags. I'm just unsure about how alternative config files can be used, since this is a library rather than an executable programme.

Comment thread docs/usage.md
@ns-rse ns-rse merged commit 11dfae9 into main Mar 20, 2025
13 checks passed
@ns-rse ns-rse deleted the ns-rse/119-parametrise-jpk-in-config branch March 20, 2025 15:05
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.

3 participants