pypsa-meets-earth/pypsa-earth

Execution of prepare_gas_network not regulated by __main__

Open

#1,655 opened on Mar 6, 2024

 (1 comment) (0 reactions) (0 assignees)Python (349 forks)auto 404
good first issuepypsa-earth-sec transfer

Repository metrics

Stars
 (351 stars)
PR merge metrics
 (Avg merge 28d 15h) (35 merged PRs in 30d)

Description

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

Contributor guide