Skip to content

Add events.json to SIPNET events.in converter#7

Open
AritraDey-Dev wants to merge 3 commits into
feature/calval-to-eventsfrom
feature/ic-to-sipnet
Open

Add events.json to SIPNET events.in converter#7
AritraDey-Dev wants to merge 3 commits into
feature/calval-to-eventsfrom
feature/ic-to-sipnet

Conversation

@AritraDey-Dev
Copy link
Copy Markdown
Member

@AritraDey-Dev AritraDey-Dev commented May 11, 2026

Adds scripts/050_events_to_sipnet.R which converts events.json files (from #6) into SIPNET events.in format, with optional settings.xml patching to wire in ensemble paths. Tested on BU SCC , 11 events.in files, 677 events total from white_salinas_2020.
Note: #6 needs to be merged first.

@AritraDey-Dev AritraDey-Dev requested a review from dlebauer May 11, 2026 18:51
@AritraDey-Dev AritraDey-Dev changed the base branch from main to feature/calval-to-events May 11, 2026 18:52
Comment thread scripts/050_events_to_sipnet.R Outdated
library(xml2)
})

# ---- Vendored from PEcAn models/sipnet/R/write.events.SIPNET.R -------------
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.

can you help me understand - why not call PEcAn.SIPNET::write_events_sipnet? All of the information should be in events.json before write_events sipnet is called

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.

Yes,vendored it because PEcAn.model.SIPNET isn't installed in the pecan-all conda env on BU (got no pkg called PEcAn.model.SIPNET when I tried). vendoring was the quickest way to get a working test. And yes switch to calling PEcAn.SIPNET::write_events_sipnet directly if we get it added to pecan-all.

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.

Not sure is there a better way to this, maybe install it into pecan-all, or some other approach you'd prefer over vendoring?

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.

The package::function is PEcAn.SIPNET::write.events.SIPNET

As a general rule, we should not be copy-pasting functions. But there will be cases during development when we need a version of code that is not in the Conda environment, and you should be able to develop PEcAn while still using other packages in the environment.

@AritraDey-Dev AritraDey-Dev requested a review from dlebauer May 13, 2026 07:44
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.

2 participants