Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The reference results live in `benchmark/goldens/`, a copy of the goldens
generated in [LambdaGeo/terrame-docker](https://github.com/LambdaGeo/terrame-docker)
v0.1.1, which keeps the generating scripts, the original TerraME outputs, the
generator and goldens for all 21 LuccME labs. This repository keeps only the
goldens its tests use (`lab01`, `lab15`: the LuccME package's labs;
goldens its tests use (`lab01`, `lab15`, `lab03`, `lab06`: the LuccME package's labs;
`lab01_md1643`, `lab15_md10`); add one together with the component and test
that need it, never ahead of time. `lab01_md1643` and `lab15_md10` are the scenarios behind `docs/validation.md`
(same coefficients and demand as `lab01`/`lab15`, but `maxDifference` 1643
Expand All @@ -81,7 +81,7 @@ PR/commit and say so explicitly -- don't let it drift silently.
```bash
python -m venv venv && source venv/bin/activate
pip install -e ".[examples,dev]"
pytest tests/ -v # expect: 19 passed, 2 xfailed
pytest tests/ -v # expect: 73 passed, 2 xfailed (38 passed, 1 skipped without lupa)
mypy src/disslucc # expect: clean
```

Expand Down
2 changes: 2 additions & 0 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ implemented, together with the test that uses them.
| `lab01_md1643` | same, `maxDifference` 1643: iterates up to 26 times per year | `test_goldens_per_year.py`, `test_validation_lab1.py`, discriminance |
| `lab15` | PreComputedValues + DLogisticRegression + DClueSLike (`maxDifference` 300) | `test_goldens_per_year.py` |
| `lab15_md10` | same, `maxDifference` 10: iterates 56–67 times per year | `test_goldens_per_year.py`, `test_validation_lab15.py`, discriminance |
| `lab03` | PreComputedValues + CSpatialLagRegression + CClueLikeSaturation (`maxDifference` 1643) | `test_spatial_lag_golden.py`, `test_saturation_golden.py` |
| `lab06` | same as `lab03`, plus `updateYears = {2009}` (`ti` from `csAC_2009`, `data/input/csAC_2009.zip`) | `test_spatial_lag_golden.py`, `test_saturation_golden.py` |

The last year of `lab01_md1643` and of `lab15_md10` is this repository's former reference
(`benchmark/data/*.zip`).
Expand Down
Binary file added benchmark/goldens/lab03/lab03.csv.gz
Binary file not shown.
45 changes: 45 additions & 0 deletions benchmark/goldens/lab03/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"lab": "lab03",
"source": {
"script": "luccme/tests/functional/lab03.lua",
"sha256": "f32e13c853c05b0ea3df9368086e3ccc4fab8d3ba8322f39f15a7f056160a027"
},
"engine": {
"image": "terrame-luccme",
"terrame": "2.0.1",
"terralib": "5.5.1",
"luccme_commit": "6244dd461f94259efb6e1d2170d32fc7e28c033c"
},
"generator": {
"script": "benchmark/harness.lua",
"sha256": "5f7504f11442d83981565676635ffd996034f721a5ad08ec0cab082d2e948a97"
},
"status": "ok",
"years": [
2008,
2014
],
"n_cells": 6574,
"columns": [
"f_out",
"d_out",
"outros_out",
"f_pot",
"d_pot",
"outros_pot"
],
"file": {
"name": "lab03.csv.gz",
"rows": 46018,
"sha256": "dba249299d94626100b97af14cc46734a17df2a957ed36bda9ff3881c6ebba29"
},
"crosscheck_vs_original_output": {
"tolerance": 1e-09,
"max_abs_diff": {
"Lab03_2014.dbf:d_out": 5.000002148425331e-13
},
"note": "last year of the CSV compared with the .dbf files of the output folder: the script's own output and, for references, the original TerraME output"
},
"iterations_per_year": {},
"iterations_note": "continuous: LuccME's 'Number of iterations'; discrete: largest n in 'Iteration -> n' (0 = first pass accepted)"
}
118 changes: 118 additions & 0 deletions benchmark/goldens/lab03/terrame.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

Verifying Model parameters
Verifying Demand parameters
Verifying Potential parameters
Verifying Allocation parameters

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2008 Step: 0
f area: 137878 Difference: 0
d area: 19982 Difference: 0
outros area: 6489 Difference: 0
Region 1
f elas: 0.10000000002027 dir: -1 const: 0.05266679 -> 0.05266679 0 1
d elas: 0.10000000001401 dir: -1 const: 0.01431553 -> 0.01431553 0 1
outros elas: 0.10000016027163 dir: -1 const: 0 -> 0 0 1

Demand allocated correctly in 2008 Number of iterations: 0 Maximum error: 0.01040035000733
[harness] lab03: Lab03, years 2008..2014, columns f_out,d_out,outros_out,f_pot,d_pot,outros_pot

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2009 Step: 0
f area: 137418 Difference: -204
d area: 20334 Difference: 96
outros area: 6489 Difference: 0
Region 1
f elas: 0.099851813713511 dir: -1 const: 0.052648226568119 -> 0.052648226568119 -1.8563431881255e-05 0.99998143656812
d elas: 0.0995264862247 dir: 1 const: 0.014443615865131 -> 0.014443615865131 0.00012808586513093 1.0001280858651
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2009 Number of iterations: 0 Maximum error: 203.9372570531

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2010 Step: 0
f area: 137079 Difference: -287
d area: 20673 Difference: 179
outros area: 6489 Difference: 0
Region 1
f elas: 0.099791090223736 dir: -1 const: 0.052629628612048 -> 0.052629628612048 -1.8597956070319e-05 0.99998140204393
d elas: 0.099132190192513 dir: 1 const: 0.014570081884318 -> 0.014570081884318 0.00012646601918755 1.0001264660192
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2010 Number of iterations: 0 Maximum error: 286.971568782

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2011 Step: 0
f area: 136752 Difference: -358
d area: 21000 Difference: 250
outros area: 6489 Difference: 0
Region 1
f elas: 0.099739024534728 dir: -1 const: 0.052610995995854 -> 0.052610995995854 -1.8632616194334e-05 0.99998136738381
d elas: 0.0988079001206 dir: 1 const: 0.014694968507161 -> 0.014694968507161 0.00012488662284242 1.0001248866228
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2011 Number of iterations: 0 Maximum error: 357.82429921019

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2012 Step: 0
f area: 136436 Difference: -388
d area: 21316 Difference: 280
outros area: 6489 Difference: 0
Region 1
f elas: 0.099716648902286 dir: -1 const: 0.052590163421247 -> 0.052590163421247 -2.0832574607325e-05 0.99997916742539
d elas: 0.098684256490536 dir: 1 const: 0.014832621312254 -> 0.014832621312254 0.00013765280509327 1.0001376528051
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2012 Number of iterations: 0 Maximum error: 387.69424774163

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2013 Step: 0
f area: 136131 Difference: -408
d area: 21622 Difference: 300
outros area: 6489 Difference: 0
Region 1
f elas: 0.099701765439119 dir: -1 const: 0.052569287356422 -> 0.052569287356422 -2.0876064825124e-05 0.99997912393517
d elas: 0.098610855076548 dir: 1 const: 0.014968405021323 -> 0.014968405021323 0.00013578370906851 1.0001357837091
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2013 Number of iterations: 0 Maximum error: 407.20663381234

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2014 Step: 0
f area: 135836 Difference: -418
d area: 21918 Difference: 310
outros area: 6489 Difference: 0
Region 1
f elas: 0.09969381618728 dir: -1 const: 0.052548367612094 -> 0.052548367612094 -2.0919744327618e-05 0.99997908025567
d elas: 0.098582216155697 dir: 1 const: 0.015102369708185 -> 0.015102369708185 0.00013396468686188 1.0001339646869
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2014 Number of iterations: 0 Maximum error: 417.18589488399

Saving Lab03_2014.
Elapsed time: 00:00:04 hh:mm:ss

End of Simulation
[harness] lab03: 5 files of the lab's own output in /work/out/lab03
[harness] lab03: CSV written to /work/out/lab03
Binary file added benchmark/goldens/lab06/lab06.csv.gz
Binary file not shown.
45 changes: 45 additions & 0 deletions benchmark/goldens/lab06/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"lab": "lab06",
"source": {
"script": "luccme/tests/functional/lab06.lua",
"sha256": "1248ddfea1df91ef6bd07aea3ff325fc748e10107883c548d69ae35a20041b5b"
},
"engine": {
"image": "terrame-luccme",
"terrame": "2.0.1",
"terralib": "5.5.1",
"luccme_commit": "6244dd461f94259efb6e1d2170d32fc7e28c033c"
},
"generator": {
"script": "benchmark/harness.lua",
"sha256": "5f7504f11442d83981565676635ffd996034f721a5ad08ec0cab082d2e948a97"
},
"status": "ok",
"years": [
2008,
2014
],
"n_cells": 6574,
"columns": [
"f_out",
"d_out",
"outros_out",
"f_pot",
"d_pot",
"outros_pot"
],
"file": {
"name": "lab06.csv.gz",
"rows": 46018,
"sha256": "456b5346f631028b7dae3e2cad247760e59abc57de40d549e02f2331f163d1b6"
},
"crosscheck_vs_original_output": {
"tolerance": 1e-09,
"max_abs_diff": {
"Lab06_2014.dbf:d_out": 5.000002148425331e-13
},
"note": "last year of the CSV compared with the .dbf files of the output folder: the script's own output and, for references, the original TerraME output"
},
"iterations_per_year": {},
"iterations_note": "continuous: LuccME's 'Number of iterations'; discrete: largest n in 'Iteration -> n' (0 = first pass accepted)"
}
121 changes: 121 additions & 0 deletions benchmark/goldens/lab06/terrame.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

Verifying Model parameters
Verifying Demand parameters
Verifying Potential parameters
Verifying Allocation parameters

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2008 Step: 0
f area: 137878 Difference: 0
d area: 19982 Difference: 0
outros area: 6489 Difference: 0
Region 1
f elas: 0.10000000002027 dir: -1 const: 0.05266679 -> 0.05266679 0 1
d elas: 0.10000000001401 dir: -1 const: 0.01431553 -> 0.01431553 0 1
outros elas: 0.10000016027163 dir: -1 const: 0 -> 0 0 1

Demand allocated correctly in 2008 Number of iterations: 0 Maximum error: 0.01040035000733
[harness] lab06: Lab06, years 2008..2014, columns f_out,d_out,outros_out,f_pot,d_pot,outros_pot

Updating dynamic variables...
layer_2009

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2009 Step: 0
f area: 137389 Difference: -233
d area: 20331 Difference: 93
outros area: 6489 Difference: 0
Region 1
f elas: 0.09983074185143 dir: -1 const: 0.052648226568119 -> 0.052648226568119 -1.8563431881255e-05 0.99998143656812
d elas: 0.099542216292271 dir: 1 const: 0.014443615865131 -> 0.014443615865131 0.00012808586513093 1.0001280858651
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2009 Number of iterations: 0 Maximum error: 232.93682142338

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2010 Step: 0
f area: 137053 Difference: -313
d area: 20667 Difference: 173
outros area: 6489 Difference: 0
Region 1
f elas: 0.099772292812196 dir: -1 const: 0.052629628612048 -> 0.052629628612048 -1.8597956070319e-05 0.99998140204393
d elas: 0.099162815645913 dir: 1 const: 0.014570081884318 -> 0.014570081884318 0.00012646601918755 1.0001264660192
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2010 Number of iterations: 0 Maximum error: 312.79287200209

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2011 Step: 0
f area: 136729 Difference: -381
d area: 20991 Difference: 240
outros area: 6489 Difference: 0
Region 1
f elas: 0.099722588869631 dir: -1 const: 0.052610995995854 -> 0.052610995995854 -1.8632616194334e-05 0.99998136738381
d elas: 0.098851979284461 dir: 1 const: 0.014694968507161 -> 0.014694968507161 0.00012488662284242 1.0001248866228
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2011 Number of iterations: 0 Maximum error: 380.35929244847

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2012 Step: 0
f area: 136417 Difference: -408
d area: 21304 Difference: 268
outros area: 6489 Difference: 0
Region 1
f elas: 0.099702461272719 dir: -1 const: 0.052590163421247 -> 0.052590163421247 -2.0832574607325e-05 0.99997916742539
d elas: 0.098740566525434 dir: 1 const: 0.014832621312254 -> 0.014832621312254 0.00013765280509327 1.0001376528051
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2012 Number of iterations: 0 Maximum error: 407.10642724726

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2013 Step: 0
f area: 136115 Difference: -424
d area: 21607 Difference: 285
outros area: 6489 Difference: 0
Region 1
f elas: 0.099689657048882 dir: -1 const: 0.052569287356422 -> 0.052569287356422 -2.0876064825124e-05 0.99997912393517
d elas: 0.098678829724857 dir: 1 const: 0.014968405021323 -> 0.014968405021323 0.00013578370906851 1.0001357837091
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2013 Number of iterations: 0 Maximum error: 423.73931471611

Executing Demand component
Executing Potential component
Executing Allocation component

Year: 2014 Step: 0
f area: 135822 Difference: -431
d area: 21900 Difference: 293
outros area: 6489 Difference: 0
Region 1
f elas: 0.099683763142858 dir: -1 const: 0.052548367612094 -> 0.052548367612094 -2.0919744327618e-05 0.99997908025567
d elas: 0.098660722562989 dir: 1 const: 0.015102369708185 -> 0.015102369708185 0.00013396468686188 1.0001339646869
outros elas: 0.10000016027163 dir: 0 const: 0.0 -> 0.0 0.0 1.0

Demand allocated correctly in 2014 Number of iterations: 0 Maximum error: 430.88351101935

Saving Lab06_2014.
Elapsed time: 00:00:05 hh:mm:ss

End of Simulation
[harness] lab06: 5 files of the lab's own output in /work/out/lab06
[harness] lab06: CSV written to /work/out/lab06
Binary file added data/input/csAC_2009.zip
Binary file not shown.
Loading
Loading