NCAR / music-box

A box/column model using MICM chemistry
Apache License 2.0
14 stars 8 forks source link

Setting up a project script #173

Closed K20shores closed 5 days ago

K20shores commented 6 days ago

To get the script to work with

[project.scripts]
music_box = "acom_music_box:main"

We need to be able to run something like from acom_music_box import main; main()

To achieve that, I had to rename music_box_main.py to acom_music_box.py and put everything inside the if __name__ == '__main__': block into a function called main

carl-drews commented 6 days ago

This solution concerns me, because acom_music_box was already the project/package name before I started work. I was also following the pattern in the test cases:

if __name__ == "__main__":
    test = TestChapman()
    test.test_run()

Maybe the scripts simply have to have a main(). Let me investigate your rename suggestion a little bit more.