Skip to content

[WIP] Reader for new commondata#1548

Closed
scarlehoff wants to merge 16 commits into
masterfrom
reader_for_new_commondata
Closed

[WIP] Reader for new commondata#1548
scarlehoff wants to merge 16 commits into
masterfrom
reader_for_new_commondata

Conversation

@scarlehoff
Copy link
Copy Markdown
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 force-pushed the reader_for_new_commondata branch from 0a94f2d to 8d63b67 Compare August 1, 2022 15:34
@scarlehoff scarlehoff changed the base branch from NEW_COMMONDATA to master August 1, 2022 15:56
@Zaharid
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants