XENONnT / straxen

Streaming analysis for XENON
BSD 3-Clause "New" or "Revised" License
19 stars 33 forks source link

Generate only one instance for `MongoDownloader` #1398

Closed dachengx closed 1 week ago

dachengx commented 2 weeks ago

Before you submit this PR: make sure to put all operations-related information in a wiki-note, a PR should be about code and is publicly accessible

What does the code in this PR do / what does it improve?

Similar to https://github.com/XENONnT/straxen/pull/1397 but in another approach. When trying downloader = straxen.MongoDownloader(), unless *args or **kwargs changed for MongoDownloader, return the already existed instance of MongoDownloader.

Can you briefly describe how it works?

Can you give a minimal working example (or illustrate with a figure)?

Please include the following if applicable:

Notes on testing

All italic comments can be removed from this template.

coveralls commented 2 weeks ago

Coverage Status

coverage: 91.083% (-0.07%) from 91.154% when pulling 729eb9cd5e188b5251eb304dac91b792982e2041 on mongo_downloader_2 into 7a4edcebac5b6fc165b71de79ae19ede6e7a52d6 on master.

coveralls commented 2 weeks ago

Coverage Status

coverage: 91.161% (+0.007%) from 91.154% when pulling 729eb9cd5e188b5251eb304dac91b792982e2041 on mongo_downloader_2 into 7a4edcebac5b6fc165b71de79ae19ede6e7a52d6 on master.