mwvgroup / pittgoogle-user-demos

GNU General Public License v3.0
2 stars 0 forks source link

Use `pittgoogle-client` instead of `pgb-broker-utils` #5

Closed troyraen closed 4 months ago

troyraen commented 2 years ago

Update all necessary code/files to remove the pgb-broker-utils python package, and instead use tools from pittgoogle-client.

mwvgroup/pittgoogle-client#6 is a PR containing a major refactor of pittgoogle-client, so this likely needs to wait until that is done. After that happens, we'll need to check and see which functions/classes still need to be added to pittgoogle-client for this to work (and then add them).

wmwv commented 1 year ago

https://github.com/mwvgroup/pittgoogle-client/pull/6 has been merged. What's the next step for this current Issue?

troyraen commented 1 year ago

Thanks, we need to evaluate what still needs to be added to pittgoogle-client. Below is my rundown from looking at the imports in classifier/main.py. Perhaps I can spend a little time this weekend to knock out the simpler ones. @wmwv if there are particular items that would be helpful to prioritize for #13, let me know.

from broker_utils import data_utils, gcp_utils, math

This is using:

from broker_utils.types import AlertIds
from broker_utils.schema_maps import load_schema_map, get_value
from broker_utils.data_utils import open_alert
troyraen commented 1 year ago

The way that schema maps are currently implemented is a pain and I don't have a clear solution right now.

Jotting down some thoughts: This should probably be handled by pittgoogle.pubsub.Alert without the user having to do anything except specify which survey the alert is coming from (and possibly the schema version). The schema maps should be packaged with the pittgoogle-client so that they don't have to be supplied or retrieved from somewhere else.

troyraen commented 1 year ago

I've started working on this, but realized that simply porting these functions over is really not the way to go. Most of this should be handled by the pittgoogle.pubsub.Alert class, so I'm implementing new methods there.