pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
20 stars 17 forks source link

Execution of prepare_gas_network not regulated by __main__ #300

Open davide-f opened 6 months ago

davide-f commented 6 months ago

Describe the feature you'd like to see

The execution of the script of prepare_gas_network does not occur using the typical main, but it is executed at import. Usually we desire something like:

if __name__ == "__main__":
   call_func_do_stuff()

but in our case it is a mix:

if __name__ == "__main__":
   something()

call_func_do_lots_of_stuff()

That can be difficult to maintain