iiasa / aneris

Harmonization of Emissions Trajectories for Integrated Assessment Models
Apache License 2.0
4 stars 11 forks source link

Add black #50

Closed lewisjared closed 2 years ago

lewisjared commented 2 years ago

Use black to consistently format code. It could also be worth using a pre-commit hook so that this is handled automatically on commit.

Also adds black checks to stickler

gidden commented 2 years ago

Thanks @lewisjared - I will acquiesce to turning aneris to the dark side

lewisjared commented 2 years ago

I'll figure out what's happening tomorrow

lewisjared commented 2 years ago

Ok I think I fixed the problem. There was a usage of pd_read in the aneris.utils, but it wasn't imported because it exploded due to a cyclic dependency. aneris.utils imported aneris._io.pd_read and aneris._io imported functions from aneris.utils. To resolve that I moved pd_read and pd_write to aneris.utils which breaks that cycle.

This isn't a breaking change as pd_read is exposed via aneris.pd_read already.

The other option is to late import the module, but that just hides the fact that there is a cycle.

gidden commented 2 years ago

Sounds good! Rerunning CI now.

gidden commented 2 years ago

Thanks @lewisjared !