genai-impact / ecologits

🌱 EcoLogits tracks the energy consumption and environmental footprint of using generative AI models through APIs.
https://ecologits.ai/
Mozilla Public License 2.0
36 stars 3 forks source link

Double initialization #15

Closed adrienbanse closed 3 months ago

adrienbanse commented 3 months ago
adrienbanse commented 3 months ago

I'm not sure if there is a workaround that allows not to export TracerInitializationError in __init__.py to use it in the tests We can also just check if it raises an Exception

samuelrince commented 3 months ago

Looks great!

I'm not sure if there is a workaround that allows not to export TracerInitializationError in __init__.py to use it in the tests We can also just check if it raises an Exception

Can't you just import it with from genai_impact.tracer import TracerInitializationError?

Also, not mandatory, but I find it to be a good practice to centralize the possible exceptions of the package in a separate module called exceptions.py. And have a global exception GenAIImpactError that is inherited by all the other exceptions.

PS: I can't wait to change the name, it makes my eyes bleed to see GenAIImpact in the class names!

adrienbanse commented 3 months ago

@samuelrince Right! Yes it's not the optimal naming haha It's implemented