Skip to content
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 API for checking for model consistency? #29

Open
f4lco opened this issue Jun 28, 2021 · 2 comments
Open

Add API for checking for model consistency? #29

f4lco opened this issue Jun 28, 2021 · 2 comments

Comments

@f4lco
Copy link
Contributor

f4lco commented Jun 28, 2021

I'd consider adding an API for extensive consistency checks in the model definitions. The annotations like @FixedField or @FixedFormat leave room for errors and inconsistencies. For example:

  1. All @FixedField annotations together do not describe the dataset exhaustively, meaning there are gaps in the data which do not map onto a @FixedField.
  2. The length of a format pattern exceeds the length allocated by @FixedField.
  3. The length of the @FixedField is too small to accommodate the nested @FixedObject.
  4. ...

I have already prototyped the first rule - all fields must be 'contiguous' / 'gapless' - and found it to be very useful, because the check already identified a typo in one of my model objects.

Mind that this is not only about detectable error conditions, but also about heuristics. As a result, one could have different severity levels like 'error', or 'warning'.

What do you think? Does such a feature fit the scope of your project?

@joutvhu
Copy link
Owner

joutvhu commented Jun 28, 2021

I think these rules are unnecessary.

Users don't need to create fields they don't want.

  • Can skip a part of the input string to get only what they want.
  • Can override the position of another field when they want to parse it to another data type.

@joutvhu
Copy link
Owner

joutvhu commented Jun 28, 2021

However in the case of writing these rules can be checked and given as a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants