Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to have a proper package #48

Open
BDonnot opened this issue Mar 2, 2022 · 1 comment
Open

Refactor to have a proper package #48

BDonnot opened this issue Mar 2, 2022 · 1 comment

Comments

@BDonnot
Copy link
Collaborator

BDonnot commented Mar 2, 2022

For example, why are the provided backend outside of chronix2grid ?

This is surprising at best

@BDonnot
Copy link
Collaborator Author

BDonnot commented Mar 2, 2022

All imports need to be cleaned and improved...

For example, we cannot do:

from PypsaDispatchBackend.PypsaEconomicDispatch import PypsaDispatcher

It leads to:

  File "pypsa_loss.py", line 12, in <module>
    from PypsaDispatchBackend.PypsaEconomicDispatch import PypsaDispatcher
  File "/home/donnotben/Documents/chronix2grid_gaetan/PypsaDispatchBackend/PypsaEconomicDispatch.py", line 16, in <module>
    from .EDispatch_L2RPN2020.run_economic_dispatch import main_run_disptach
  File "/home/donnotben/Documents/chronix2grid_gaetan/PypsaDispatchBackend/EDispatch_L2RPN2020/run_economic_dispatch.py", line 25, in <module>
    import chronix2grid.constants as cst
  File "/home/donnotben/Documents/chronix2grid_gaetan/chronix2grid/constants.py", line 73, in <module>
    from PypsaDispatchBackend.PypsaEconomicDispatch import PypsaDispatcher
ImportError: cannot import name 'PypsaDispatcher' from partially initialized module 'PypsaDispatchBackend.PypsaEconomicDispatch' (most likely due to a circular import) (/home/donnotben/Documents/chronix2grid_gaetan/PypsaDispatchBackend/PypsaEconomicDispatch.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant