-
Notifications
You must be signed in to change notification settings - Fork 4
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
MAD-NG Features and Compatibility Modes #135
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ception stack can be slow)
…icit before making it OFF by default
jgray-19
approved these changes
Dec 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really looked at the new stuff, but all the omc3 tests pass.
JoschD
requested changes
Dec 20, 2024
Also: add a test for writing that takes a |
…ty headers but also providing headers to write function uses the latter
JoschD
approved these changes
Dec 20, 2024
And away we go. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Priority: High
Work on this!
Status: Review Needed
Work currently stopped, untils someone else reviews it.
Type: Documentation
Improvements, updates and fixes to the documentation.
Type: Feature
A (suggetion for a) new feature or enhancement in functionality.
Type: Maintenance
Improvements in the code, that are not necessarily visible in functionality.
Type: Release
Issue preparing for a release.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MAD-NG Compatibility
This PR close #104 and closes #105. I will make a new issue for some exotic caveats (see caveat subsection below).
While users relying on default parameters will not be affected, I label this as a major version release as there is a substantial amount of behavioural changes.
Main Changes
Full details relevant to the users can be found in the Changelog, details are given in sections below. Main items are:
MAD-NG
feature).MAD-NG
feature).Some changes and fixes also show up:
TfsDataFrame
validation is now skipped on reading by default.TfsDataFrame
validation is by default done inMAD-X
compatibility mode before writing.pandas.DataFrame
- now works correctly.MAD-NG Features
Changes have been made to support boolean and complex values, both in headers and columns.
Special care is taken for the parsing of complex values given that the MAD-NG representation uses
i
for the complex part while Python usesj
.I am adding comments on the PR to help review.
Caveat
Some of the more exotic features that can happen from
MAD-NG
are not supported, as discussed. These include for instance the overloaded ranges (i.e.1..7
) and for these the user should usepymadng
and do conversions in memory. I will create an issue on the repo to be tagged "wontfix" or similar.Should a user encounter this, then an
UnknownTypeIdentifierError
is raised (see maintenance changes). I am open to directing them towardspymadng
in the error message.Validation
The validation has been reworked and offers compatibility guarantees with
MAD-X
orMAD-NG
. A valid mode should be provided to thetfs.frame.validate
function, which acceptsMADX
/MAD-X /
MADNG/
MAD-NG` (case-insensitive).Validation can still be skipped when reading or writing by providing
None
.Details on the applied rules are given in the documentation so I won't duplicate them here. I'll point it out as PR comments.
Added Tests
I have added an entirely new module for all tests related to validation.
I have also added a bunch of reader and writer tests to cove the new (
MAD-NG
) features.I have added new TFS files in the inputs for each of these features, and I have added a compressed version (for each supported format) of a file containing them all to the relevant folder.
Added Documentation
Docstrings have been updated everywhere relevant.
The documentation now holds a dedicated page detailing the TFS format (this closes #105).
There is also a dedicated page about validation and compatibility modes (this closes #104).
I heavily encourage downloading the built documentation from CI and having a look locally.
Maintenance Changes
The most substantial maintenance change is the introduction of many new errors to be raised, which are each specific to a given problem one might encounter. They all inherit from the (previously unique)
TfsFormatError
, so users that were catching this one will not see their code broken.I have made a slew of maintenance changes to the documentation: fixing warnings during generation, updating deprecated configuration parameters, fixed typos, tried to make a lot of things more explicitely explained, fixed broken links etc.
There are also a bunch of maintenance changes made to the tests. Mainly, I have moved quite a few common fixtures to the
conftest.py
file to avoid the duplications we had through files. I have tried to separate a bit more different testing parts.I will add PR comments to the code to make it easy to determine what is new vs what is maintenance.