nu-radio / NuRadioReco

reconstruction framework for radio detectors of high-energy neutrinos
GNU General Public License v3.0
5 stars 3 forks source link

Optional singleton #267

Closed christophwelling closed 3 years ago

christophwelling commented 3 years ago

Addresses #266 No you can pass create_new=True to a Singleton's call method to explicitly create a new class instance

cg-laser commented 3 years ago

I think it is not clear yet how to call a new detector instance (at least not to me). Can you provide an explicit example? And ideally also add it to the docstring of the detector class as this is the point where people will look first?

christophwelling commented 3 years ago

so e.g. det = Detector(source='json', create_new=True) will do the job?

Yes. I also noticed that by default the init is not listed in the rendered documentation. I made a commit to change that for all classes.

cg-laser commented 3 years ago

I think this is good to go but can you add the new parameter to the docstring of the detector init function. I think otherwise it will be very difficult to see that this parameter exists.

clark2668 commented 3 years ago

Just wanted to comment that I started using this, and it was very helpful. Also looks good to merge after you're happy with the docs. Thanks!

christophwelling commented 3 years ago

Then can someone approve this, so we stick to the process?

christophwelling commented 3 years ago

I added it. Looks like sphinx does not know how to handle metaclasses, that's a bit unfortunate.