This is pertaining to the Python version of AGFusion (latest version, installed from pip).
This bug was described years ago here: murphycj/agfusionweb-react#4
The web app bugfix worked, but the correct behavior was not recapitulated in the Python version. Initially I thought the author has not gotten around to fixing this in the Python version, but a closer look into the only script this behavior depends on, reveals that a fix has been incorporated, but it was not thoroughly tested (there is a simple syntax error that goes unnoticed by Python somehow).
Below is the patched version of model.py.
model.py
If you are having the same issue and wants a quick fix, you can use this patched model.py script as a drop-in simply by following these steps:
-
Copy and paste the patched model.py script below into a new file using your favourite text editor and save it as model.py precisely (or download it as model.py using the link above)
-
Find where the installed package of AGFusion is located in your machine by running:
python -c "import agfusion; import os; print(os.path.dirname(agfusion.__file__))"
This returns a path to the directory where model.py should be located. For example, the path to agfusion of my machine is /opt/conda/lib/python3.12/site-packages/agfusion.
- Change directory (
cd) into this directory, rename model.py to back the unpatched version up
cd /opt/conda/lib/python3.12/site-packages/agfusion && cp model.py model.py.backup
- Now mv the patched version of
model.py you saved/downloaded to this location. For example, if you downloaded it to your Downloads folder, then do this:
mv ~/Downloads/model.py ./
Now you can rerun AGFusion and AGFusion should run with the correct behaviour. As the edit I made is purely syntactic, this should be very safe. I am not creating a pull request because the author is no longer maintaining this repo.
This is pertaining to the Python version of AGFusion (latest version, installed from pip).
This bug was described years ago here: murphycj/agfusionweb-react#4
The web app bugfix worked, but the correct behavior was not recapitulated in the Python version. Initially I thought the author has not gotten around to fixing this in the Python version, but a closer look into the only script this behavior depends on, reveals that a fix has been incorporated, but it was not thoroughly tested (there is a simple syntax error that goes unnoticed by Python somehow).
Below is the patched version of
model.py.model.py
If you are having the same issue and wants a quick fix, you can use this patched
model.pyscript as a drop-in simply by following these steps:Copy and paste the patched
model.pyscript below into a new file using your favourite text editor and save it asmodel.pyprecisely (or download it as model.py using the link above)Find where the installed package of AGFusion is located in your machine by running:
This returns a path to the directory where
model.pyshould be located. For example, the path to agfusion of my machine is/opt/conda/lib/python3.12/site-packages/agfusion.cd) into this directory, renamemodel.pyto back the unpatched version upmodel.pyyou saved/downloaded to this location. For example, if you downloaded it to your Downloads folder, then do this:Now you can rerun AGFusion and AGFusion should run with the correct behaviour. As the edit I made is purely syntactic, this should be very safe. I am not creating a pull request because the author is no longer maintaining this repo.