firetools / qgis2fds

An open source and free tool to export terrain elevation, landuse, and georeferencing to NIST FDS for computational fluid dynamics (CFD) wildfire or atmospheric pollutants dispersion simulations.
GNU General Public License v3.0
17 stars 13 forks source link

Replace broken verification cases and rewire the verification (avoid leftovers, both from actions and locally) #86

Open emanuelegissi opened 1 year ago

emanuelegissi commented 1 year ago

Someone "burned" the local landuse layer. It took me hours to understand that the fire_layer algorithm was working correctly, but the landuse was tainted. Please @Jonathan, do not touch them. I am going to replace the broken files with good ones.

johodges commented 1 year ago

good catch, not sure when that occurred. Let me know once you have added the updated file layers and I can update the figures repo with the passing cases.

emanuelegissi commented 1 year ago

Hi Jonathan, I uploaded an attempt at the new golden_gate_local test. The goal is being as similar as possible to the official FDS wildfire cases.

Here are the main mods, in no particular order:

  1. I dropped test_ from the directory name
  2. Inside the folder, you find 3 directories: QGIS, FDS and scripts:
    1. In QGIS you find the sheets, layers folders and the qgs file.
    2. In FDS you find only the case and nothing else except a .gitignore. This folder should always be cleaned in advance by the script when a test is performed, to prevent artifacts.
    3. In scripts there are several test scripts. The scripts should be self-sufficient: they clean the FDS folder, run QGIS, run FDS, call the image comparison script, and report back to the calling run.sh.

Regarding the overall structure of the verification folder, the goal is avoiding any incidental pollution of the structure when the verification is run:

  1. run.sh should be the main entry point to the verification suite. This script should enter into the test folder hierarchy, browse the directories, run all the script in the scripts subfolders, collect the test results, write a logfile (eg. 20230821-0920.log) and the error images in a folder (named eg. 20230821-0920) in the logs folder. The script run.sh should know nothing about the tests: just run the scripts and collect the results. Modularity is future-proof.
  2. The general scripts are moved to the scripts folder. I prefer to have them in python that in bash, for preventing future headaches.
  3. The tests coming from the fds cases (eg. chimney_tops) should not be copied from the cad repo, but called. This to prevent divergences.
  4. All temporary files should be created in the /tmp directory, to prevent leftovers in case of errors.

Speaking about git actions, the exact same run.sh should be run. The goal is avoiding maintaining two different testing facilities.

And I still think that a separate repo for the verification cases is better, if possible.

Before starting any work on this, I suggest reaching a consensus, so that we head in the same direction. In the meantime, I keep cleaning qgis2fds code, and testing it by hand.

Let me know what you think on this.

emanuelegissi commented 1 year ago

Forgot to add:

  1. I intend to move to python all the scripts, included the test scripts. But one thing at a time ;-)
  2. See the test scripts, they inject the $CHID.ini and $CHID.ssf files too. The goal is fully separating the test from the FDS folder.
johodges commented 1 year ago

Some progress on this made in https://github.com/firetools/qgis2fds/pull/89. Implemented changes:

There is still an open issue on this: