mountaindust / Planktos

ABM framework for dispersal modeling
https://planktos.readthedocs.io
GNU General Public License v3.0
5 stars 3 forks source link

Reorganize code, add setup.py #28

Closed mountaindust closed 2 years ago

mountaindust commented 3 years ago

There's starting to be a bit of a code smell, and bringing in code that needs to be compiled (#26) is going to make that worse. Refactor code into a planktos (lowercase) directory with an init .py file which can also include dataIO, and a future analysis module. Create a setup.py file, and revisit the examples and past_projects organization. Also reconsider the purpose/name of mv_swarm.py (in the context of #27) while moving into the planktos directory.

mountaindust commented 3 years ago

read_IBAMR3d_py27.py and read_vtk_py27.py are misfits at the moment, but with the planned support for Python 3 in VisIt 3.2 (visit issue #4082), these modules can eventually be incorporated into dataIO. So for the time being, let's just leave them where they are.

mountaindust commented 3 years ago

update_positions will revert to returning the new position of the swarm rather than setting it, under the new name get_positions. Even though this is less pretty from an OOP point of view, it protects swarm.positions from being over-written by an array that does not contain the correct mask information. So far, the only reason this hasn't happened is because the new positions have always been calculated using swarm.positions, which has cast its mask onto the result. This is a terrible thing to rely on, and constitutes a bug. Fixed in 4588dd4.

mountaindust commented 3 years ago

A major code refactor has been accomplished as of b68eb39, and all that is left todo on this issue is to get a setup.py up and running. However, there are probably bigger fish to fry at the moment, so this is getting demoted to low priority.

mountaindust commented 2 years ago

setup.py has been depreciated in favor of setup.cfg.