Conversation
|
Hi @aleeciu - I didn't get around to this recently; still working on a test. Would be happy if you could already have a first look, but totally cool if you don't run anything yet. |
|
@aleeciu I've now committed unit tests, but here comes the hard part - I'm so out of touch with you guyses CI pipeline that I don't know how to add the lxml dependency or to graciously catch it if it's not already present. I guess this is also for @emanuel-schmid : I don't want to burden |
not sure about this, I think there could be some interest. Anyway it's on @emanuel-schmid to decide whether we are fine with adding lxml. |
| """Missing double and integers in ecCodes """ | ||
|
|
||
| CXML2CSV_XSL = Path(__file__).parent / "tc_tracks_foreast_cxml2csv.xsl" | ||
| """Path at which an xsl is found for transforming CXML to CSV format.""" |
There was a problem hiding this comment.
do we want this file here or in the climada/data folder? @emanuel-schmid
There was a problem hiding this comment.
We certainly don't want it here. climada_petals/hazard/data folder maybe. Or climada data api. Depends on what is that file. What's inside, who wrote it and how, will it ever change, can we have it as csv file instead?
There was a problem hiding this comment.
So that file is required to translate the downloaded file from cxml into csv. It was written by @mmyrte, I'd say we can consider it as the standard CLIMADA file when working with these .cxml files. The module was written such that a user can potentially define locally his/her own conversion file and, if so, this standard file won't be used. On whether it can also be written as .csv it's for @mmyrte but I doubt.
There was a problem hiding this comment.
@emanuel-schmid No, it's not a data file; it's XSL, so it contains transformation logic.
mmyrte
left a comment
There was a problem hiding this comment.
I'm happy now. @aleeciu I don't know whether there are still things that need to be approved by @emanuel-schmid, but if it's really just the question of where in the file tree the xsl is positioned, that can easily be adjusted later on. I say we merge, unless there are new policies in place that I don't know of.
|
@mmyrte thanks for this new feature. To me it looks quite fine. I will make a tutorial and test it with different providers. Then I think we can merge ? Do you anything else on your TODO list ? |
|
To summarise our call:
Cheers Jan |
Sounds like a plan |
Also includes default type coercion for Path arguments to lxml's etree.parse; it can only handle pathlike args since v. 4.8.0
| """Missing double and integers in ecCodes """ | ||
|
|
||
| CXML2CSV_XSL = Path(__file__).parent / "data/cxml_ecmwf_transformation.xsl" | ||
| """Xsl file for transforming CXML to CSV format.""" |
There was a problem hiding this comment.
@emanuel-schmid I have now created a data folder in hazard and moved this transformation file therein. I am not sure whether this is the best place or if it should go somewhere else. I have tried to move it in my climada/data folder but then I get an error from jenkins that it does not find the file (I think I should have also changed something in the CONFIG file but I am not sure what).
|
Hi @emanuel-schmid, to me this this now works (many thanks @mmyrte) and it's ready to be merged. Open issue is where to locate the data:
Thanks. |
|
One last comment - I still don't think that application logic such as that contained in the xsl file should be in a "data" directory, since I find the name misleading. It's up to you guys though. |
This is a work in progress for a Cyclone XML (cxml) reader for TC forecast products. I'm currently testing it with data from ECMWF, see https://confluence.ecmwf.int/display/TIGGE/Tools#Tools-tc, but due to the clear XML specs, it should work with all providers. General structure:
I've tried making it robust against duplicate/false labels in the input data, such as I encountered here (wrong basin designations), but cannot be sure yet.
Missing: Tests, gracious handling of missing dependencies, documentation.