Comments (4)
Thank you for catching this and bringing it to our attention. The code in the example is more up-to-date with best practices of grabbing information from the yaml files. I am updating the language in the example tutorial accordingly (#526 ), thanks to your prompt.
from wisdem.
Ok, thank you, I will refer to the example code then. I think I got it to work, but I noticed that the validation method will fail if the file path is provided as a PosixPath instead of a string:
WARNING: Be sure to pip install simpy and marmot-agents for offshore BOS runs
Traceback (most recent call last):
File <path>, line 22, in <module>
data = load_geometry_yaml(baseyaml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File <path>, line 128, in load_geometry_yaml
return validate_with_defaults(finput, fschema_geom)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib/python3.12/site-packages/wisdem/inputs/validation.py", line 122, in validate_with_defaults
DefaultValidatingDraft7Validator(yaml_schema).validate(myobj)
File "lib/python3.12/site-packages/jsonschema/validators.py", line 438, in validate
raise error
jsonschema.exceptions.ValidationError: PosixPath('/home/user/project/nrel5mw.yaml') is not of type 'object'
Also, would it be possible to include e.g. the reference turbines in the distribution to make them accessible via importlib.resources
? Or does it mean legal trouble to redistribute the models?
from wisdem.
I'm not sure what the suggested action is on the yaml read functions. Is this just for your own script? Seems like you can just convert to a string before passing to the function?
On the reference turbine files, you are asking for the files to be installed as package data files instead of just files in this example directory?
from wisdem.
Sure, I also ended up converting the Path object to a string myself - however, keep in mind that unfamiliar users like myself would expect Path objects to work for file paths, and the error message isn't clearly stating that the yaml validation function is expecting the file paths to be provided only as strings, leaving the impression that the validation function might be broken.
Regarding the turbine reference files: yes, I think that is what me from a month ago was suggesting - I am not really sure about the benefits anymore though.
from wisdem.
Related Issues (20)
- Wisdem env activation HOT 8
- jacketSE HOT 3
- DLL load failed while importing _precomp HOT 5
- Error when running compare_designs (example 3) HOT 10
- Example 3 HOT 2
- Intel MPI build fails to import MPI HOT 4
- Doubts on the outputs of the blade structural optimization HOT 4
- Spar cap thicknesses plot HOT 18
- Error in documentation of direct-drive layout HOT 1
- GeneratorSE DFIG optimisation: Positive directional derivative for linesearch HOT 5
- Rated Wind Speed as input HOT 2
- Cannot install on linux arm64 (Mac M1) HOT 1
- Cannot install on windows HOT 5
- error in examples 15_step_size_study HOT 1
- Reference axis not updating in model yaml HOT 13
- For pyFrame3DD 'exitCode' has a value of 181 HOT 2
- Please reduce the number of cores, currently set to 1, to the number of finite differences 0 HOT 20
- After successfully installing m2w64-toolchain libpython, Conda runs code that prompts "No module named 'mpi4py'" HOT 6
- ImportError: cannot import name 'validate_without_defaults' from 'wisdem.inputs' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wisdem.