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 stash attribute for python objects #100

Closed
achaikou opened this issue May 3, 2019 · 1 comment
Closed

Add stash attribute for python objects #100

achaikou opened this issue May 3, 2019 · 1 comment

Comments

@achaikou
Copy link
Contributor

achaikou commented May 3, 2019

Starting point:
Let's say that DLIS file has an Equipment object with various attributes set. But in one of them there is a typo, "AGULAR-DRIFT" instead of "ANGULAR-DRIFT".
Current code would iterate through all the attributes in DLIS file, would reach "AGULAR-DRIFT" attribute and won't be able to map it to any attribute in the "attributes" dictionary. Hence current code would throw KeyError, which eventually will be caught and object would be transformed into Unknown object.

Suggestion is to add "stash" attribute to objects. Stash should be a dictionary which contains all the DLIS attributes that were not mapped into known ones and be populated along in the load method.
Thus custom/mistyped attributes present in official objects won't turn objects into Unknown.

Additionally Unknown object can be reconstructed:

  • to have all its values in stash
  • to have empty "attributes" field to correspond with "attributes" field in other objects (know it has totally different meaning, so some confusion).
    This should simplify the code and allow us to use the same "load" method for all the objects.
@achaikou
Copy link
Contributor Author

Closed with #107

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

No branches or pull requests

1 participant