Skip to content
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

Unreasonable fes.generate_fes KeyError #531

Open
cecilia-hong opened this issue May 21, 2024 · 5 comments
Open

Unreasonable fes.generate_fes KeyError #531

cecilia-hong opened this issue May 21, 2024 · 5 comments

Comments

@cecilia-hong
Copy link

In the umbrella_sampling.py when I try to run the following:

fes.generate_fes(u_kn, chi_n, fes_type="histogram", histogram_parameters=histogram_parameters)
on my data, I get this error:

KeyError: (0,)

It was unclear what the problem was but I have gotten it down to the fact that some of the bins for making the histograms were empty and instead of plotting a 0 height bin, I got the above error.

Is fixing range and number of bins used for my analysis the correct fix or should the program figure this out itself?

@mrshirts
Copy link
Collaborator

Just checking - did you modify the code or data, or is this running the precise example provided? Thanks!

@cecilia-hong
Copy link
Author

Hi, so when I run the example on the data provided it was fine so I used the same script for my data and only edited things like:

  • "number of umbrellas"
  • "max number of frames"
  • "temperature"

Up until the fes.generate_fes part everything looked fine and similar to that of the examples

@mrshirts
Copy link
Collaborator

Ah, OK, so really, this is probably about improving the error handling when some of the bins are empty.

What I would say is 1) longer term, I need to look into providing better error messages, and 2) short, term, you should either use fewer bins (note that the number of BINS and BIASED SIMULATIONS are completely separate - you only need to adjust the number of bins in the REPRESENTATION of the PMF, not in the generation of data), or you could go back and add additional biased simulations so that the area where the bin was empty has samples. OR also use kernel density representation of the PMF instead.

TODO @mrshirts: improve error handling when bins are empty!

@Lnaden
Copy link
Contributor

Lnaden commented May 21, 2024

This might be a bug related to #511 (with #502) and #528. @mrshirts can you check those over and see if the report there and see if the proposed solutions look good for resolving this?

@cecilia-hong
Copy link
Author

Thank you for your help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants