AU-BCE-EE / tric-fil-mod

A trickling filter model to simulate air treatment, written in Python
GNU General Public License v3.0
0 stars 0 forks source link

Demo/test directory structure #4

Closed sashahafner closed 1 year ago

sashahafner commented 1 year ago

We need a place for demos or tests.

sashahafner commented 1 year ago

In be6dba0accbd3de1e561b1cd692cc4d723a2715d I've added a demo sub-directory. @afeilberg you can use the first few blocks in demos/01.../demo.py as a template. I've added some comments.

sashahafner commented 1 year ago

Importing a "module" that is in a different directory is surprisingly complicated. I expected this to work:

from ../../tfmod import tfmod

But it doesn't. We can change (add to) the folders Python checks for modules but it seemed simpler to me to just copy the tfmod.py script in each time. That way we'll also have a copy of the last version of the model that was used for any particular demo, which isn't bad. The shutil (shell utilities I guess) is needed:

import shutil
shutil.copy('../../tfmod.py', '.')
from tfmod import tfmod

We can find a better solution later.