You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using my proper folder for the aerodynamics airfoils profile file (in aerodynamics).
The .toml (and now .yaml) was giving as an option the file name my_naca.af and aerodynamics was previously (v0.5.4b version of FAST-OAD) looking for the file in my dedicated path using copy_ressource function (see openvsp.txt).
The problem is now FASTOADProblemConfigurator._parse_problem_table() includes auto-completion for passed option whose name finish by file (ex: wing_airfoil_file):
name.endswith("file") = True
Which lead to have as an option my_oad_test_function_path\my_naca.af:
options[name] = pth.join(conf_dirname, option_value)
And that leads to an error for me since the file is obviously not located here.
I think it should be mentioned for users at least (or corrected if it was not the way pretending to be used). My way around will be to rename the options in my dedicated function to avoid that issue (because I want beginner users to use airfoil names that can be listed and not specify complete path).
christophe-david
changed the title
[Not Issue but comment] Defining file name in .yaml file for module option using your proper ressource folder!
Defining file name in .yaml file for module option using your proper resource folder
May 5, 2021
We have to use this trick for many other options to work: it is often natural to allow that the configuration file contains relative path for some file-related options, and we cannot handle that at module level, where the path of the configuration file is not available.
As you have seen, modifying the option name is a solution. But if you expect your user to be able to provide its own file also, then he will have to provide an absolute path, because you avoid the mechanism that resolves relative paths from the folder of configuration file.
A second solution is what we use in the performance module, where we need to provide the possibility to choose a mission file that can be bundled, or custom. When choosing a bundled file, user has to provide the name, preceded by ::.
Currently, this trick is managed in the mission module, that trims whatever is found before ::, but we should probably provide this mechanism in a general way.
I'm currently using my proper folder for the aerodynamics airfoils profile file (in aerodynamics).
The .toml (and now .yaml) was giving as an option the file name my_naca.af and aerodynamics was previously (v0.5.4b version of FAST-OAD) looking for the file in my dedicated path using copy_ressource function (see openvsp.txt).
The problem is now FASTOADProblemConfigurator._parse_problem_table() includes auto-completion for passed option whose name finish by file (ex: wing_airfoil_file):
name.endswith("file") = True
Which lead to have as an option my_oad_test_function_path\my_naca.af:
options[name] = pth.join(conf_dirname, option_value)
And that leads to an error for me since the file is obviously not located here.
I think it should be mentioned for users at least (or corrected if it was not the way pretending to be used). My way around will be to rename the options in my dedicated function to avoid that issue (because I want beginner users to use airfoil names that can be listed and not specify complete path).
oad_process_be76.txt
openvsp.txt
The text was updated successfully, but these errors were encountered: