Open jfrederik-nrel opened 5 months ago
This is a good catch @jfrederik-nrel , maybe the easiest solution is then to add such code to the load_csv_long function so we don't clutter the example scripts themselves?
Yes that was my thinking too. I'm just not sure how straightforward that would be and whether there are other functions that have the same issue but are not used in the examples.
When I'm running the examples using VS Code through Anaconda Navigator on my Windows computer, it automatically makes
floris
(i.e., the base folder) the running directory, instead of the folder in which the example is located (i.e.,floris/examples
). As a result, when the examples (e.g.,003_wind_data_objects.py
or006_get_farm_aep
) try to load theinputs/wind_rose.csv
file, it can't be found because it's looking in a non-existing directory.This issue can easily be solved by the user adding
examples
to the path when loading the wind rose, but we probably want users on Windows to also be able to run the examples without having to change anything in the code. It also seems that someone at some point was aware of this issue, as I have noticed thatFlorisModel
does load the yaml files correctly due to this little try-except added tofloris_model.py
:Perhaps we'll want to add a similar code snippet to other functions that load data from files, such as
WindRose.read_csv_long()
used to loadwind_rose.csv
in some of the examples.I'm experiencing this issue on the v4 branch, but it seems to be a general problem not related to a specific version of FLORIS.