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

[WIP] Reader for new commondata #1548

Closed
wants to merge 16 commits into from
Closed

Conversation

scarlehoff
Copy link
Member

@scarlehoff scarlehoff commented Apr 5, 2022

We used #1526 as a scratchpad during the meeting so I'll leave it be and instead move here whatever is needed.

For now I've added just a jupyter notebook that reads the new commondata into pandas dataframes.

@enocera @Zaharid if you are ok with those df I'll port the rest (coredata.py and core.py, specs and so) using that as the underlying objects.

(why would the test pass here but not in #1500?)

@scarlehoff scarlehoff changed the base branch from NEW_COMMONDATA to master August 1, 2022 15:56
@Zaharid
Copy link
Contributor

Zaharid commented Aug 1, 2022

I think it is entirely proper to deprecate python 3.8 whenever we get around merging this.

" raise ValidationError(f\"{path_str} is not a valid path\") from e\n",
" \n",
"@Parser\n",
"def ValidOperation(op_str: str) -> str:\n",
Copy link
Contributor

@Zaharid Zaharid Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use enums, or Literal for better structure here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the OPs list you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed. Would make for better error messages.

"\n",
"# Scalar parsers\n",
"@Parser\n",
"def ValidPath(path_str: str) -> Path:\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want things with more checks, like ExistingFilePath? For fun I tried to reach the error using the visible keys on my keyboard and could not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see when I actually use it but I'm not sure at this stage the path will be testable for existence

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine either way. Don't have to check for everything at this stage but it sure is nice when sensible.

" FK_tables: list\n",
" operation: ValidOperation\n",
" conversion_factor: float = 1.0\n",
" apfelcomb: dict = None\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Optional[dict]. And probably more structured.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan is to remove all dictionaries (if that's what you mean with the structure)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but also that as it is the default does not type check.

@scarlehoff scarlehoff changed the base branch from master to NEW_COMMONDATA August 3, 2022 10:42
@scarlehoff scarlehoff changed the base branch from NEW_COMMONDATA to master August 3, 2022 10:42
@scarlehoff
Copy link
Member Author

scarlehoff commented Aug 3, 2022

Since it is impossible to read the files that have changed I will move the reader to a new branch off master which the commondata added by @enocera in #1500 but this branch will not target that one nor the old data will be removed. We can merge both branches once this is finished.

scarlehoff added a commit that referenced this pull request Aug 3, 2022
…ary files for the reader (no removals or rawdata)
@scarlehoff scarlehoff closed this Aug 3, 2022
@scarlehoff scarlehoff deleted the reader_for_new_commondata branch August 3, 2022 11:04
scarlehoff added a commit that referenced this pull request Dec 14, 2022
…ary files for the reader (no removals or rawdata)
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

Successfully merging this pull request may close these issues.

None yet

4 participants