Skip to content

Issue loading csv files in examples -> working directory not same as file directory for VS Code on Windows #873

@jfrederik-nrel

Description

@jfrederik-nrel

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 or 006_get_farm_aep) try to load the inputs/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 that FlorisModel does load the yaml files correctly due to this little try-except added to floris_model.py:

image

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 load wind_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogTasks that need to be done but aren't scheduled. Higher priority than ideas-list.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions