[WIP] Proposal for the common data reader#1583
Conversation
|
@Zaharid the structure of the whole commondata is finished, before continuing, could you have review If you could also check |
|
|
||
|
|
||
| @Parser | ||
| def ValidOperation(op_str: str) -> str: |
There was a problem hiding this comment.
I think we could do ValidOPeration = Literal[*list_of_operations].
Edit, unless we insist on allowing "AdD" and similar.
There was a problem hiding this comment.
I'm afraid I don't know what you mean here. How should I write this in validobj language?
There was a problem hiding this comment.
Literally my comment. With ‘list_of_operations’=OP or whatever.
…ary files for the reader (no removals or rawdata)
…, uncertainties and data
0cf3087 to
e39b513
Compare
|
@scarlehoff You'll likely have DIS+DY after Christmas. |
|
yes DY should be finalised shortly after christmas |
|
Ok, in the meantime I’ll give a try to reading the old commondata into the new format (so that libNNPDF can be dropped) |
|
|
||
|
|
||
| @Parser | ||
| def ValidVariants(variant_dict: dict) -> Dict[str, Variant]: |
There was a problem hiding this comment.
This is not needed. Can be just the return type and will be processed recursively as done manually in the function.
There was a problem hiding this comment.
You mean that it will be able to understand that it is a dict of Variants by itself or the Parser is not needed?
| arXiv: Optional[ValidReference] = None | ||
| iNSPIRE: Optional[ValidReference] = None | ||
| hepdata: Optional[ValidReference] = None | ||
| variants: Optional[ValidVariants] = dataclasses.field(default_factory=dict) |
There was a problem hiding this comment.
This should not be optional if the default is not going to be None
There was a problem hiding this comment.
I can put the default to None of course. It is just a question of adding a If variants is None in a few places.
There was a problem hiding this comment.
Can as well make it a dict. But at the moment if you do set it to none it is broken in several places.
This is a continuation of #1548 with only the absolutely necessary files so that the code review and maintenance during development is a bit easier.