databio / bbconf

Configuration package for bedbase project
https://pypi.org/project/bbconf/
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

bbconf seems to be initiating everything twice #30

Closed nsheff closed 8 months ago

nsheff commented 8 months ago

Why does it say "Initialize..." two times? This has been happening for awhile.

bbc = BedBaseConf("../bedbase.org/config/bedbase.yaml")
2023-10-26 08:57:08,392 : DEBUG : Creating pipestat objects...
Creating pipestat objects...
Config: /home/nsheff/code/bedbase.org/config/bedbase.yaml.
Initialize DBBackend
Config: /home/nsheff/code/bedbase.org/config/bedbase.yaml.
Initialize DBBackend
nsheff commented 8 months ago

Could this be because there are 2 pipestat manager objects, and so it's doing it twice?

If so, wouldn't it make more sense to have these handled by a single entity with a single database connection?

I guess that would argue that there the database connection should be independent of the pipestat manager and reusable by it, or some other encompassing thing that allows multiple PSMs to use one database connection

donaldcampbelljr commented 8 months ago

Yes, it initializes a separate pipestatmanager object for bedfiles and bedsets.

khoroshevskyi commented 8 months ago

I think this issue should be transferred to pipestat, as we are using pipestat to initialize connection

nsheff commented 8 months ago

it's bbconf that's using 2 pipestatmanagers. but it may require new pipestat functionality to handle 2 psms with only 1 db connection.

nsheff commented 8 months ago

I think it's not worth making major changes to address this. This at least notifies the user about the difference: https://github.com/pepkit/pipestat/commit/8aba8ba4a745d6ecbaf0e37fef41a338b45b3e59 We can revisit this in the future if we want to.