Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on how to add validation for custom types #499

Open
jd-lara opened this issue May 30, 2020 · 4 comments
Open

Add documentation on how to add validation for custom types #499

jd-lara opened this issue May 30, 2020 · 4 comments
Assignees

Comments

@jd-lara
Copy link
Member

jd-lara commented May 30, 2020

It isn't clear currently what's the process to avoid the warning

┌ Warning: struct MyCustomDevice does not exist in validation configuration file, validation skipped
└ @ InfrastructureSystems ~/.julia/dev/InfrastructureSystems/src/validation.jl:42
@daniel-thom
Copy link
Contributor

daniel-thom commented Aug 21, 2020

This means that the descriptor file does not contain the struct being used. We have an oversight in this process. A user might want validation of a struct without doing auto-generation. Is that what is happening here?

It might be better to make this warning message a debug message.

@jd-lara
Copy link
Member Author

jd-lara commented Aug 21, 2020

we currently throw a warning when there is no valid entry for a custom struct validation. We want to add validation for the DynamicInverter and also make sure that the validations on the field values of components are conducted.

@daniel-thom
Copy link
Contributor

My earlier statement was incorrect. You can define a validation descriptor for a struct that is not auto-generated by adding an entry here: https://github.com/NREL-SIIP/PowerSystems.jl/blob/master/src/descriptors/power_system_structs.json#L9581.

There are a few options:

  1. Add the descriptor.
  2. Implement a method for the function IS.validate_struct(ist::InfrastructureSystemsType). (validate based on fields in struct)
  3. Implement a method for the function PSY.validate_struct(sys::System, value::PowerSystemType). (validate based on system)

@kdayday
Copy link
Contributor

kdayday commented Dec 30, 2024

@jd-lara another stale issue -- we currently have very sparse documentation for validation, but this doesn't seem to be a documentation problem on its own. I'm removing the label.

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

No branches or pull requests

3 participants