-
Notifications
You must be signed in to change notification settings - Fork 355
MarkupText improvements & save_all() #5799
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
base: python-dev
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## python-dev #5799 +/- ##
==============================================
+ Coverage 95.28% 95.40% +0.12%
==============================================
Files 35 35
Lines 3031 3134 +103
==============================================
+ Hits 2888 2990 +102
- Misses 143 144 +1
🚀 New features to boost your workflow:
|
This is potentially timely. I am trying to do the following:
Will this work? WIP script here. |
@mjpost Modifying only NameSpecifications won't be detected, so |
I think |
Just like the changes that are in this PR. |
Okay, I pushed one more change here that refactors the code I already had (for |
@mjpost You can already call Also: # find the person with the non-explicit ID
for person in people:
if not person.is_explicit:
break
if not person: I don't think this does what you think it does — if all people are explicit, |
This commit adds two main features:
1. Simplified usage of MarkupText
Before:
After:
Instead of requiring that markup text is always instantiated explicitly via a builder function like
MarkupText.from_string(...)
, it can now simply be set as a string, in which case it will be parsed viaMarkupText.from_latex_maybe(...)
automatically. This should greatly simplify the API for the most common use case.2. Added
Anthology.save_all()
This didn't exist before because writing all XML files takes quite some time. This PR adds a hook to classes that automatically sets
Collection.is_modified = True
whenever an attribute on a collection/volume/paper/event is changed. Consequently, there's now anAnthology.save_all()
that only saves those XML files that have actually been modified.Minor changes/additions
Anthology.venues.create()
.if "ACL Anthology" in paper.title
without having to explicitly convert it to a string first.