-
Notifications
You must be signed in to change notification settings - Fork 19
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 option to omit field numbers #65
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 80.93% 82.79% +1.85%
==========================================
Files 7 7
Lines 278 308 +30
==========================================
+ Hits 225 255 +30
Misses 53 53 ☔ View full report in Codecov by Sentry. |
Thanks for the PR! That looks all super reasonable. Would you mind renaming the option |
Also sounds reasonable! I decided to do |
Cool, thanks so much! I'll leave this open for 24h in case somebody else wants to chime in and otherwise merge and release tomorrow. |
I'm on vacation so don't have time to look at the spec etc - I'm not super keen on complicating the API here if STOPGAP isn't compliant and the field numbers are part of the spec, in that case I would prefer that you maintain a simple fork/depend on the lower level functionality within this package Let me know your thoughts! |
As far as I can tell, field numbers are not part of the spec. I could be wrong but none of the examples I have seen (Wikipedia, original publication, and 2021 conference abstract) use them. Feel free to wait to confirm/deny until you're done with vacation. |
The only part of the spec is that everything after
That means that technically STOPGAP is not following the spec by not ignoring them. But, my feeling is that this is not something that really complicates the API, but gives you more control about what is written. So I would merge it. |
Huh okay, I've internalised a RELION-ism it seems - let's merge here! |
Oh, I didn't think of it as comment handling. I can ask Will about updating STOPGAP to check for sharp-delimited comments. |
Yes, cisTEM also adds these little headers over the values using the sharp-comment, which is kinda nice when looking at them:
In any case, I still think it's worthwhile adding these options if they help for some cases without interfering with the default behavior. |
After sleeping on it I think it's up to @sjrothfuss whether to go ahead: If you think this is not necessary because the comment handling can be included in STOPGAP, we should probably avoid adding the extra code, as minimal as it is. But if you think this will help to smooth things over with existing versions of STOPGAP, let's merge. |
Thanks @jojoelfe. Let me talk to Will about why STOPGAP doesn't handle field name comments. |
Will and I agreed we'd add comment handling to STOPGAP motl reading. Comments are actually already implemented in other star reading, just hadn't been added to motl reading since STOPGAP motls weren't expected to have comments. |
To summarize as regards this package, since field numbers are actually just line comments whether to include them (like RELION) or not (like STOPGAP) is just a style decision. Since AB is keen to keep options few, this package should only offer one and I don't see a convincing reason to change what is done currently. Adding package credits to the top of every file does seem a little tacky but that's a different issue. 😉 |
@sjrothfuss is a holdover from when things were less robust, was useful for debugging issues! Happy to discuss on an issue/accept PRs to change the behaviour 🙂 |
I hope to use this package in Python STOPGAP but it is imperative that the star files produced (e.g. motls, tomolists, parameters) are compatible with legacy MATLAB STOPGAP. The files produced by this package are incompatible with MATLAB STOPGAP in a couple ways. One of which is the inclusion of field numbers after field names, i.e., a field name in the loop block is rendered as
_fieldname #n
.This PR creates the
include_field_num
option to omit that number such that the field name would be just_fieldname
.include_field_num
is optional and defaults to True for back compatibility.