-
Notifications
You must be signed in to change notification settings - Fork 231
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
Si.to_df() does not work with parameter groups #387
Comments
Thanks for the feedback and credit on your GitHub! You wanted a example here it is. I add a correction to my previous solution because it was working only when the problem was declared via the read_param_file method. Indeed, when the problem dict was declared in the python script it wasn’t working. ( it is good to create a small test case!) The new correction uses "if self.problem.get('groups'):" instead of "if self.problem['groups'] is not None:" which is more standard toward the entire package and works properly. In fact, when groups does not exists in a problem declare in the script then self.problem['groups'] does not exist and then it fails. I join in the message the following files:
Basically, there is four different problems declared and a function called on each problems that calls saltelli.sample , a dummy evaluation function , analyse.sobol and Si.to_df(). Hope it done now! input_param_withgroup.txt Sincerely Mickaël. |
Hi @Mickael01 First and foremost, thank you for this. This issue was already addressed in the recent development version (as yet not officially released) but only for the Sobol analysis method (see here) I will extend your proposed tests to cover the other methods. Could you let me know what version of SALib you're using? If it's a much older version we could release a patch for you. |
Yes, i am using conda and I install the SAlib version 1.3.11 via conda-forge (my pandas version is 1.1.3). conda install -c conda-forge salib By the way when I follow your link for the recent development version, I navigate throught utils_func here and found the 'check_group' function but not the 'extract_group_names' function just so you know. More I read python projects like ours, more I realize that I need to declare more functions but smaller than mine ! I have a python script with two none standalone functions to plot S1, ST and S2. Sincelery Mickaël. |
Hi Mickaël Yes, Python import rules are strange 😉 Making these things more obvious is a long-term goal of mine. |
Tests added for Sobol' and Morris methods (in #392). Other methods will have to wait 'til later. |
bug and solution from Mickaël Trochet. Thank you!
The function
Si.to_df()
currently only works for thenames
key, but not whengroups
is defined.Proposed fixes below, sent by Mickaël. This looks good and is ready for a PR. It could also be nice to add a unit test about this issue.
The text was updated successfully, but these errors were encountered: