eco4cast / neon4cast

A helper R package for the neon4cast challenge
Other
7 stars 7 forks source link

Metadata: read_csv error #2

Closed CaseyMiddleton closed 2 years ago

CaseyMiddleton commented 3 years ago

Hello! I am running into an error when creating the metadata for our team's submission. We currently store the forecast submission csv and metadata in a subdirectory of our root folder to keep organized. We use the provided create_model_metadata function with the path to our forecast csv to create the metadata, which works without any issue. However, the write_metadata_eml function throws an error that '' does not exist in working directory.

This error seems to be thrown when theme is used to create file paths that do not exist in the package. I believe this is because theme expects our file path for forecast_file and metadata_yaml to begin with the challenge theme instead of subdirectories for our file path. For example, theme is assigned as "data/forecasts/phenology" for our file path, but it seems to work properly if only "phenology" is included. However, I imagine removing these subdirectories would require us to store all files in the root directory, which is not a great option organizationally. Do you have any suggestions for a workaround here, and has any other team run into this problem? Thanks so much for your help and great work putting together these functions for submission!

cboettig commented 3 years ago

@rqthomas Just skimming here, but guessing that the theme name extraction on

https://github.com/eco4cast/neon4cast/blob/main/R/metadata.R#L46-L47

may not be sufficiently robust? Path logic is always a pain.

rqthomas commented 3 years ago

@caseymid48 Which theme are you submitting to and what is your forecast file name?

CaseyMiddleton commented 3 years ago

Phenology - apologies about not clarifying that! I agree with Carl that it seems to be a string parsing / path issue, so perhaps using the same logic you are currently implementing but only considering characters after the last "/"? I wish I could be more help - I am newish to R. I really appreciate all the work you have put into this workflow.

rqthomas commented 3 years ago

@caseymid48 I think the latest commit fixed the issue. Can you test and let me know?

CaseyMiddleton commented 3 years ago

That worked! Thanks a lot, Quinn.