NREL / electrolyzer

Other
20 stars 16 forks source link

Implement validated configuration files #11

Closed camirmas closed 1 year ago

camirmas commented 2 years ago

Is your feature request related to a problem? Please describe.

Users need a structured way to define their Electrolyzer runs. Other NREL repos (e.g. WISDEM/WEIS/Fl) use YAML config files which are validated using JSONSchema, and electrolyzer would benefit from the same treatment. While we won't have a large number of configuration values to start with, this will grow in time, and starting with this approach will avoid future issues as well as provide users with a familiar interface. Additionally, defined schemas lend themselves well to auto-generated documentation.

Describe the solution you'd like

  • [ ] Implement an electrolyzer configuration schema that encompasses all options for individual electrolyzers as well as control schemes for multiple electrolyzers. Use precedents set in WISDEM
  • [ ] Apply schema validation prior to electrolyzer runs using jsonschema package
  • [ ] Allow Electrolyzer and ElectrolyzerSupervisor to be instantiated via Dict generated from YAML config
  • [ ] Add electrolyzer example runs to examples

Describe alternatives you've considered

The team has previously discussed the use of attrs to define classes. This library also includes validators. However, for ease of documentation generation, we may want to rely on jsonschema for this. However, attrs might still prove useful in that we can use it for easier class instantiation as well as static type checking.

Additional context

camirmas commented 2 years ago

Here's a first take on the potential options, will update with more specific information shortly.

nRiccobo commented 2 years ago

Would it be 1 yaml file to rule all the attributes? Or multiple depending on the context?

After the conversation about cost modelling, I wonder how many parameters and options we would include. Just some ideas:

camirmas commented 2 years ago

Yes! I intend for this to take inspiration from the windIO spec that is used in WISDEM and elsewhere. The windIO spec has a costs section that specifies parameters for LCOE analysis as well as categories for other important elements like control, materials, etc.

genevievestarke commented 2 years ago

Just adding what we discussed on Wednesday: