-
Notifications
You must be signed in to change notification settings - Fork 2
Python Mixing Implementation #17
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
base: master
Are you sure you want to change the base?
Conversation
|
The namespaces could be called |
|
Please pull from master so that it shows the correct diffs |
|
|
||
| def __init__(self, mix_implementation): | ||
| self._build_prior_proto() | ||
| self.mix_implementation = mix_implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if this file does not exist?
Also, I think both this class and PythonHierarchy need more docs, explaining in detail their use linking possibly to the example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gives a ModuleNotFoundError: No module named 'something'. It seemed to us quite self-explanatory error, do you think we need to add more logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it would be better to have a check raising a more detailed error. Everything is a "module" in python, I would just write "the mix_implementation file {0} does not exist".format(mix_implementation) or something along these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We addressed this in the run_mcmc in the mixture_model.py since that's where the error actually raises. I just committed that, do you like this approach? The reason of using the old-fashioned style code was to avoid raising another ModuleNotFoundError and seeing the redundant traceback message like "During handling of the above exception, another exception occurred:" which would point to the same thing with a different message.
If there is a neater solution, we'd like to know :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good to me!
| }; | ||
| }; // namespace PyMix | ||
|
|
||
| class PythonMixing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that a high-level documentation of the full class (also for the hierarchy) would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sorry, we were focused on the presentation, we will add it soon!
| self.mix_implementation = mix_implementation | ||
|
|
||
| def prior_cluster_distribution(self, grid, nsamples): | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather logging.error that this function cannot be implemented
|
Hi all. The summer went by in exam sessions and vacations but we are willing to finish what we started :) I guess the main thing missing here was the documentation and the last remark about the |
Great hearing from you :) Yes that sounds about right! For the documentation part, I would add also a page to the docs by creating a new "rst" fine in "docs/soruces/extending_pybmix.rst", where you try to summarise the needed steps for implementing a new hierarchy / mixing. Then add a notebook with the actual implementation |
|
Hi. We added the stuff you mentioned in the last comment. Except we didn't really understand if you wanted to put the python implementations in a .ipynb file, since it can't be imported and used from a .ipynb. If you just need it for the tutorial documentations, then we can add that too. |
My bad, I just meant that it would be nice to have a ipynb that puts everything together and shows how to actually implement such a model using the library! |
Hi,
this is a first implementation of Python Mixing. As we discussed we made a branch from the hierarchy pr and added the needed files and changes to it to avoid losing all the things in common that we had. So here you will see a lot of changed files but the ones that are about the mixing are:
We are aware of some problems and we will fix them as soon as possible (changing the parameters of the PythonMixing implemented in Python, avoiding having to write pass for unused functions as for the hierarchies, adding the documentation).
We have two questions:
And in MixingHierarchy we have (note the namespace is in capital letters):
We did this to differentiate between the state of mixing and hierarchy. We think we could define only one structure in a different file and use the same for both Mixing and Hierarchy, what do you think is better?