diff --git a/.github/workflows/expl_heuristic.yml b/.github/workflows/expl_heuristic.yml index 725c92ca..7dddc5f1 100644 --- a/.github/workflows/expl_heuristic.yml +++ b/.github/workflows/expl_heuristic.yml @@ -1,30 +1,46 @@ name: expl_heuristic # Kotaro Yama +# dropped the Docker container use (DLW April 2025) + on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: expl_heuristic runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -36,18 +52,11 @@ jobs: run: | cd cell2fire python main.py --input-instance-folder ../data/Sub40x40/ --output-folder ../Results/Sub40_n5cv1 --ignitions --sim-years 1 --nsims 5 --grids --finalGrid --weather rows --nweathers 129 --Fire-Period-Length 1.0 --output-messages --ROS-CV 1.0 --seed 123 --IgnitionRad 0 --stats --spreadPlots --heuristic -1 + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest expl_heuristic.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest expl_heuristic.py diff --git a/.github/workflows/fullstat_allplot.yml b/.github/workflows/fullstat_allplot.yml index b43a238e..7f6c4720 100644 --- a/.github/workflows/fullstat_allplot.yml +++ b/.github/workflows/fullstat_allplot.yml @@ -1,30 +1,45 @@ name: fullstat_allplot # Kotaro Yama +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: fullStatAllPlot runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -32,22 +47,16 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: create input data run: | cd cell2fire python main.py --input-instance-folder ../data/dogrib/ --output-folder ../results/dogrib_n100cv05 --ignitions --sim-years 1 --nsims 3 --grids --finalGrid --weather rows --nweathers 1 --Fire-Period-Length 1.0 --output-messages --ROS-CV 0.5 --seed 123 --IgnitionRad 0 --stats --allPlots + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest fullstat_allplot.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest fullstat_allplot.py diff --git a/.github/workflows/sub20x20.yml b/.github/workflows/sub20x20.yml index 2c19dc28..45277503 100644 --- a/.github/workflows/sub20x20.yml +++ b/.github/workflows/sub20x20.yml @@ -1,30 +1,45 @@ name: sub20x20 # Test2_zonghan +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: sub20x20 runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -36,18 +51,11 @@ jobs: run: | cd cell2fire python main.py --input-instance-folder ../data/Sub20x20/ --output-folder ../results/Sub20x20 --ignitions --sim-years 1 --nsims 5 --finalGrid --weather rows --nweathers 1 --Fire-Period-Length 1.0 --output-messages --ROS-CV 0.0 --seed 123 --stats --allPlots --IgnitionRad 5 --grids --combine - + + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_20x20.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_20x20.py diff --git a/.github/workflows/testReadme1.yml b/.github/workflows/testReadme1.yml index 803a2288..27eade58 100644 --- a/.github/workflows/testReadme1.yml +++ b/.github/workflows/testReadme1.yml @@ -1,30 +1,45 @@ name: Test First Readme Example +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: readme1 runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -36,18 +51,12 @@ jobs: run: | cd cell2fire python main.py --input-instance-folder ../data/Sub40x40/ --output-folder ../results/Sub40x40 --ignitions --sim-years 1 --nsims 5 --finalGrid --weather rows --nweathers 1 --Fire-Period-Length 1.0 --output-messages --ROS-CV 0.0 --seed 123 --stats --allPlots --IgnitionRad 5 --grids --combine + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_doccmd1.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_doccmd1.py + diff --git a/.github/workflows/test_datagenerator.yml b/.github/workflows/test_datagenerator.yml index 554b6085..f3cc420f 100644 --- a/.github/workflows/test_datagenerator.yml +++ b/.github/workflows/test_datagenerator.yml @@ -2,29 +2,43 @@ name: test_datagenerator on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: test_datagenerator runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -32,18 +46,12 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_datagenentor.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_datagenentor.py + diff --git a/.github/workflows/test_dogrib.yml b/.github/workflows/test_dogrib.yml index 8d1acfe6..5330977d 100644 --- a/.github/workflows/test_dogrib.yml +++ b/.github/workflows/test_dogrib.yml @@ -1,30 +1,45 @@ name: dogrib +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: test_dogrib runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -32,22 +47,15 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: create input data run: | cd cell2fire python main.py --input-instance-folder ../data/dogrib/ --output-folder ../results/dogrib/ --ignitions --sim-years 1 --nsims 1 --finalGrid --weather rows --nweathers 1 --Fire-Period-Length 1.0 --output-messages --ROS-CV 0.0 --seed 123 --stats --allPlots --IgnitionRad 5 --grids --combine + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_dogrib.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false - + pytest test_dogrib.py diff --git a/.github/workflows/test_h1.yml b/.github/workflows/test_h1.yml index 045922ca..0c1d6a44 100644 --- a/.github/workflows/test_h1.yml +++ b/.github/workflows/test_h1.yml @@ -1,30 +1,45 @@ name: test_h1 # Kotaro Yama +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: test_h1 runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -37,17 +52,10 @@ jobs: cd cell2fire python main.py --input-instance-folder ../data/Sub20x20/ --output-folder ../results/Sub20x20/Sub20_RW_RI_N10 --sim-years 2 --nsims 10 --finalGrid --weather random --nweathers 100 --Fire-Period-Length 1.0 --ROS-CV 0.0 --seed 123 --IgnitionRad 0 --stats --output-messages --ROS-Threshold 0 --HFI-Threshold 0 --heuristic 1 + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_h1.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_h1.py diff --git a/.github/workflows/test_h2.yml b/.github/workflows/test_h2.yml index c24f13ee..f6130f0c 100644 --- a/.github/workflows/test_h2.yml +++ b/.github/workflows/test_h2.yml @@ -1,30 +1,45 @@ name: test_h2 # Kotaro Yama +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: test_h2 runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -32,22 +47,16 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: create input data run: | cd cell2fire python main.py --input-instance-folder ../data/Sub40x40/ --output-folder ../results/Sub40x40 --sim-years 2 --nsims 10 --finalGrid --weather random --nweathers 100 --Fire-Period-Length 1.0 --ROS-CV 0.0 --seed 123 --IgnitionRad 0 --stats --output-messages --ROS-Threshold 0 --HFI-Threshold 0 --heuristic 2 --customValue="../data/Sub40x40/values40x40.csv" + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_h2.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_h2.py diff --git a/.github/workflows/test_h3.yml b/.github/workflows/test_h3.yml index aa80dd02..ddea068c 100644 --- a/.github/workflows/test_h3.yml +++ b/.github/workflows/test_h3.yml @@ -1,30 +1,45 @@ name: test_h3 # Kotaro Yama +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: test_h3 runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -32,22 +47,15 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: create input data run: | cd cell2fire python main.py --input-instance-folder ../data/Sub40x40/ --output-folder ../results/Sub40x40 --sim-years 2 --nsims 10 --finalGrid --weather random --nweathers 100 --Fire-Period-Length 1.0 --ROS-CV 0.0 --seed 123 --IgnitionRad 0 --stats --output-messages --ROS-Threshold 0 --HFI-Threshold 0 --heuristic 3 --customValue="../data/Sub40x40/values40x40.csv" + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_h3.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false - + pytest test_h3.py diff --git a/.github/workflows/test_randweather.yml b/.github/workflows/test_randweather.yml index 989cd94c..7616e0d0 100644 --- a/.github/workflows/test_randweather.yml +++ b/.github/workflows/test_randweather.yml @@ -1,31 +1,47 @@ name: randweather +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: random weather runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop - + pip install -e . + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -36,18 +52,11 @@ jobs: run: | cd cell2fire python main.py --input-instance-folder ../data/Harvest40x40/ --output-folder ../Harvest40x40 --ignitions --sim-years 2 --nsims 5 --grids --finalGrid --weather random --nweathers 200 --Fire-Period-Length 1.0 --output-messages --ROS-CV 0.8 --seed 123 --stats --allPlots --IgnitionRad 1 --combine --HarvestedCells ../data/Harvest40x40/band1_2.csv - + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests - pytest test_randweather.py --cov=../cell2fire --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_randweather.py + diff --git a/.github/workflows/test_readspot.yml b/.github/workflows/test_readspot.yml index 9d53d66e..4bba6513 100644 --- a/.github/workflows/test_readspot.yml +++ b/.github/workflows/test_readspot.yml @@ -1,30 +1,45 @@ name: test_readspot +# dropped the Docker container use (DLW April 2025) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] + +defaults: + run: + shell: bash -l {0} jobs: build: - + name: test_readspot runs-on: ubuntu-latest - container: - image: dlwoodruff/c2fcondatest:latest - env: - PATH: /opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test_env + python-version: 3.12 + auto-activate-base: false + + - name: Install Boost + run: sudo apt-get update && sudo apt-get install -y libboost-all-dev + - name: Install Eigen + run: sudo apt-get update && sudo apt-get install -y libeigen3-dev - name: make C++ run: | cd cell2fire/Cell2FireC make + - name: install dependencies + run: | + pip install -r requirements.txt + pip install flake8 - name: setup the program run: | - python setup.py develop + pip install -e . - name: Lint with flake8 run: | @@ -33,17 +48,11 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Install pytest + run: pip install pytest - name: run tests run: | cd tests/test_readspot - pytest test_readspot.py --cov=../../cell2fire --cov=../ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./tests/test_readspot/coverage.xml - flags: unittests - ###env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: false + pytest test_readspot.py + diff --git a/README.md b/README.md index feaa8069..2875d9c1 100644 --- a/README.md +++ b/README.md @@ -38,14 +38,14 @@ ISSN={2624-893X} - g++ - Boost (C++) - Eigen (C++) -- Python 3.6 +- Python >3.6; you might need 3.12 - numpy - pandas - matplotlib - seaborn - tqdm - opencv -- imread +- imageio (replaced imread, April 2026) - networkx (for stats module) # Installation @@ -56,7 +56,7 @@ Installation may require some familiarity with C++, make, and Python. - make - cd ../.. - pip install -r requirements.txt # might not do anything -- python setup.py develop +- pip install -e . # Usage In order to run the simulator (after installation and cd to Cell2Fire/cell2fire), the following command can be used: diff --git a/cell2fire/Cell2FireC/parallel_code/Cell2FireParallel/Cell2FirePython_Parallel/Cell2FireC_class.py b/cell2fire/Cell2FireC/parallel_code/Cell2FireParallel/Cell2FirePython_Parallel/Cell2FireC_class.py index c283b263..0d8d611c 100644 --- a/cell2fire/Cell2FireC/parallel_code/Cell2FireParallel/Cell2FirePython_Parallel/Cell2FireC_class.py +++ b/cell2fire/Cell2FireC/parallel_code/Cell2FireParallel/Cell2FirePython_Parallel/Cell2FireC_class.py @@ -308,7 +308,7 @@ def stats(self): print("Generating initial forest plot...") FBPlookup = os.path.join(self.args.InFolder, "fbp_lookup_table.csv") if self.args.HCells is not None: - HCarray = np.loadtxt(self.args.HCells, skiprows=1, delimiter=",")[1:].astype(np.int) + HCarray = np.loadtxt(self.args.HCells, skiprows=1, delimiter=",")[1:].astype(int) print("HCArray:", HCarray) print("GForestN:", self._GForestN) self._GForestN = self._GForestN.flatten() @@ -414,7 +414,7 @@ def stats_Heur(self, OutFolder, HCells=None): print("Generating initial forest plot...") FBPlookup = os.path.join(self.args.InFolder, "fbp_lookup_table.csv") if HCells is not None: - HCarray = np.loadtxt(HCells, skiprows=1, delimiter=",")[1:].astype(np.int) + HCarray = np.loadtxt(HCells, skiprows=1, delimiter=",")[1:].astype(int) self._GForestN = self._GForestN.flatten() for i in HCarray: self._GForestN[i-1] = -1 @@ -622,7 +622,7 @@ def heur(self, AvailCells=set(), BurntCells=set(), HarvestedCells=set()): # Create the aux DF for saving the harvested cells in different files depending on the treated fraction % np.savetxt(os.path.join(csvPath, SelHeur + "_" +str(fr) + ".csv"), - np.asarray([1] + actions).reshape(1, len(actions) + 1).astype(np.int), + np.asarray([1] + actions).reshape(1, len(actions) + 1).astype(int), delimiter=",", fmt="%d", header="Year,HCells", comments='') step += 1 diff --git a/cell2fire/Cell2FireC_class.py b/cell2fire/Cell2FireC_class.py index 02322355..e7b9d3f9 100644 --- a/cell2fire/Cell2FireC_class.py +++ b/cell2fire/Cell2FireC_class.py @@ -305,7 +305,7 @@ def stats(self): print("Generating initial forest plot...") FBPlookup = os.path.join(self.args.InFolder, "fbp_lookup_table.csv") if self.args.HCells is not None: - HCarray = np.loadtxt(self.args.HCells, skiprows=1, delimiter=",")[1:].astype(np.int) + HCarray = np.loadtxt(self.args.HCells, skiprows=1, delimiter=",")[1:].astype(int) print("HCArray:", HCarray) print("GForestN:", self._GForestN) self._GForestN = self._GForestN.flatten() @@ -411,7 +411,7 @@ def stats_Heur(self, OutFolder, HCells=None): print("Generating initial forest plot...") FBPlookup = os.path.join(self.args.InFolder, "fbp_lookup_table.csv") if HCells is not None: - HCarray = np.loadtxt(HCells, skiprows=1, delimiter=",")[1:].astype(np.int) + HCarray = np.loadtxt(HCells, skiprows=1, delimiter=",")[1:].astype(int) self._GForestN = self._GForestN.flatten() for i in HCarray: self._GForestN[i-1] = -1 @@ -619,7 +619,7 @@ def heur(self, AvailCells=set(), BurntCells=set(), HarvestedCells=set()): # Create the aux DF for saving the harvested cells in different files depending on the treated fraction % np.savetxt(os.path.join(csvPath, SelHeur + "_" +str(fr) + ".csv"), - np.asarray([1] + actions).reshape(1, len(actions) + 1).astype(np.int), + np.asarray([1] + actions).reshape(1, len(actions) + 1).astype(int), delimiter=",", fmt="%d", header="Year,HCells", comments='') step += 1 diff --git a/cell2fire/utils/Heuristics.py b/cell2fire/utils/Heuristics.py index cd1d3412..970fcf7b 100644 --- a/cell2fire/utils/Heuristics.py +++ b/cell2fire/utils/Heuristics.py @@ -28,7 +28,7 @@ # Genetic algorithm from deap import algorithms, base, creator, tools -from scipy.ndimage.measurements import label +from scipy.ndimage import label # Genetic selection object class GenHeur(object): @@ -67,7 +67,7 @@ def GeneticSel(self, AvailCells, VolCells, Demand, Utility, Year): Given an individual, check the number of adjacent components (in matricial form) """ def adjConstraint(individual): - structure = np.ones((3, 3), dtype=np.int) + structure = np.ones((3, 3), dtype=int) labeled, ncomponents = label(individual, structure) return ncomponents """ @@ -917,8 +917,8 @@ def runHeur(self, AvailCells, Adjacents, VolCells, Demand, Utility, Year): # Update auxiliary sets toHarvestCells = set(idx[:Demand]) - TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(np.int) - 1] - TotalUtility += Utility[np.asarray(idx[:Demand]).astype(np.int) - 1] + TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(int) - 1] + TotalUtility += Utility[np.asarray(idx[:Demand]).astype(int) - 1] if self._verbose: print("Initial values") @@ -1034,8 +1034,8 @@ def runHeur(self, AvailCells, Adjacents, VolCells, Demand, Utility, Year): # Update auxiliary sets toHarvestCells = set(idx[:Demand]) - TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(np.int) - 1] - TotalUtility += Utility[np.asarray(idx[:Demand]).astype(np.int) - 1] + TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(int) - 1] + TotalUtility += Utility[np.asarray(idx[:Demand]).astype(int) - 1] if self._verbose: print("Initial values") @@ -1156,8 +1156,8 @@ def runHeur(self, AvailCells, Adjacents, VolCells, Demand, Utility, Year): # Update auxiliary sets toHarvestCells = set(idx[:Demand]) - TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(np.int) - 1] - TotalUtility += Utility[np.asarray(idx[:Demand]).astype(np.int) - 1] + TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(int) - 1] + TotalUtility += Utility[np.asarray(idx[:Demand]).astype(int) - 1] AvailCells -= set(idx[:Demand]) # Information @@ -1348,8 +1348,8 @@ def runHeur(self, AvailCells, Adjacents, VolCells, Demand, Utility, Year): # Update auxiliary sets toHarvestCells = set(idx[:Demand]) - TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(np.int) - 1] - TotalUtility += Utility[np.asarray(idx[:Demand]).astype(np.int) - 1] + TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(int) - 1] + TotalUtility += Utility[np.asarray(idx[:Demand]).astype(int) - 1] AvailCells -= set(idx[:Demand]) if self._verbose: @@ -1387,8 +1387,8 @@ def runHeur(self, AvailCells, Adjacents, VolCells, Demand, Utility, Year): # Update auxiliary sets toHarvestCells = set(idx[:Demand]) - TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(np.int) - 1] - TotalUtility += Utility[np.asarray(idx[:Demand]).astype(np.int) - 1] + TotalProduction += VolCells[np.asarray(idx[:Demand]).astype(int) - 1] + TotalUtility += Utility[np.asarray(idx[:Demand]).astype(int) - 1] AvailCells -= set(idx[:Demand]) # Information @@ -1556,8 +1556,9 @@ def Global_FPVPlot(self, normalized=False, xticks=50, yticks=50): for _, spine in ax.spines.items():spine.set_visible(True) # Save + # savefig calls used to have figsize=(200, 200), (april 2025) plt.savefig(os.path.join(self._OutFolder, "Global_FPV_Graph_Normalized_v" + str(self._version)+ ".png"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) plt.close("all") @@ -1584,8 +1585,9 @@ def Global_FPVPlot(self, normalized=False, xticks=50, yticks=50): plt.colorbar(sm, cax=cax) # Save it to Heuristic folder + # removed figsize=(200, 200), April 2025 plt.savefig(os.path.join(self._OutFolder, "Global_FPV_Graph_v" + str(self._version)+ ".png"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) plt.close("all") @@ -1635,9 +1637,10 @@ def Ind_FPVPlot(self, nSim, FPVMatrix, normalized=False): vmin=0, vmax=np.max((FPVMatrix))) # Save it to plots folder + # removed figsize=(200, 200) from savefig April 2025 plt.savefig(os.path.join(self._OutFolder, "Plots", "Plots" + str(nSim), "FPV_Graph" + str(nSim) + ".png"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) plt.close("all") diff --git a/cell2fire/utils/Plot.py b/cell2fire/utils/Plot.py index a7a30342..31139b1d 100644 --- a/cell2fire/utils/Plot.py +++ b/cell2fire/utils/Plot.py @@ -1,5 +1,5 @@ # coding: utf-8 -__version__ = "2.0" +__version__ = "2.1" __author__ = "Cristobal Pais" __maintainer__ = "Jaime Carrasco, Cristobal Pais, David Woodruff" __status__ = "Alpha Operational" @@ -7,7 +7,7 @@ # Importations # import sys import os -import imread +import cv2 #Visual importations from matplotlib.pylab import * @@ -300,7 +300,8 @@ def forest_plotV3(self,Cells_Obj,msg_list,counter,period,Year,showtrue,r,col,Fol PathFile = os.path.join(Folder,"forest"+fstr+".png") #Save the file - plt.savefig(PathFile, dpi=200, figsize=(200, 200), bbox_inches='tight', transparent=True) + # removed figsize=(200, 200), April 2025 + plt.savefig(PathFile, dpi=200, bbox_inches='tight', transparent=True) plt.close("all") if showtrue == True: @@ -486,7 +487,9 @@ def forest_plotV3_Operational(self, Cells_Obj, msg_list, counter, period,Year, PathFile = os.path.join(Folder,"forest"+fstr+".png") #Save the file - plt.savefig(PathFile, dpi=200, figsize=(200, 200), bbox_inches='tight', transparent=True) + # removed figsize=(200, 200), April 2025 + + plt.savefig(PathFile, dpi=200, bbox_inches='tight', transparent=True) plt.close("all") if showtrue == True: @@ -670,7 +673,8 @@ def forest_plotV3_FreeMem(self, Cells_Obj, msg_list, counter, period, Year, show PathFile = os.path.join(Folder,"forest"+fstr+".png") #Save the file - plt.savefig(PathFile, dpi=200, figsize=(200, 200), bbox_inches='tight', transparent=True) + # removed figsize=(200, 200), April 2025 + plt.savefig(PathFile, dpi=200, bbox_inches='tight', transparent=True) plt.close("all") if showtrue == True: @@ -686,14 +690,14 @@ def forest_plotV3_FreeMem(self, Cells_Obj, msg_list, counter, period, Year, show ''' # Mixes the evolution plots with the base forest (initial state for saving memory/time) def Mix(self,Folder,filen,Sim): - img = imread(os.path.join(Folder, "ForestInitial.png")) + img = cv2.imread(os.path.join(Folder, "ForestInitial.png")) fstr = str(filen).zfill(4) #Path and name of the file PathFile = os.path.join(Folder, "Plots", "Plots"+str(Sim), "forest" + fstr + ".png") # Reads the basic forest - img2 = imread(PathFile) + img2 = cv2.imread(PathFile) # Over plot gca().set_axis_off() @@ -710,7 +714,7 @@ def Mix(self,Folder,filen,Sim): def MultiFireMix(self,Folder,nSims,mode="Scale",probs=[]): # Read initial forest status - imgForest = imread(os.path.join(Folder, "ForestInitial.png")) + imgForest = cv2.imread(os.path.join(Folder, "ForestInitial.png")) #fstr = str(filen).zfill(4) # If no probs provided, alpha = 0.25 by default (otherwise, transparency is proportional to the fire probability) @@ -730,7 +734,7 @@ def MultiFireMix(self,Folder,nSims,mode="Scale",probs=[]): imgArray = [] for i in range(nSims): - imgArray.append(imread(PathFile[i])) + imgArray.append(cv2.imread(PathFile[i])) #print(imgArray[i].shape) # Summation mode: sum the pixels values for highlighting the intersections of fires (more intense than Scale) @@ -767,4 +771,4 @@ def MultiFireMix(self,Folder,nSims,mode="Scale",probs=[]): # Save the combined picture plt.savefig(os.path.join(Folder, "Plots", "MultiFire_Plot"+mode+".png"), dpi=200, bbox_inches='tight', pad_inches=0) - plt.close("all") \ No newline at end of file + plt.close("all") diff --git a/cell2fire/utils/Stats.py b/cell2fire/utils/Stats.py index 0fe8d9ec..f0998999 100644 --- a/cell2fire/utils/Stats.py +++ b/cell2fire/utils/Stats.py @@ -165,7 +165,7 @@ def BoxPlot(self, Data, xx="Hour", yy="Burned", xlab="Hours", ylab="# Burned Cel plt.title(title) #sns.set(style="darkgrid", font_scale=1.5) - ax = sns.boxplot(x=xx, y=yy, data=Data, linewidth=2.5, palette=pal).set(xlabel=xlab,ylabel=ylab) + ax = sns.boxplot(x=xx, y=yy, hue=xx, data=Data, linewidth=2.5, palette=pal, legend=False).set(xlabel=xlab, ylabel=ylab) if swarm: ax = sns.swarmplot(x=xx, y=yy, data=Data, linewidth=2.5, palette=pal).set(xlabel=xlab,ylabel=ylab) @@ -288,7 +288,7 @@ def BPHeatmap(self, WeightedScar, Path=None, nscen=10, sq=False, namePlot="BP_He plt.title(Title) # Modify existing map to have white values - cmap = cm.get_cmap('RdBu_r') + cmap = matplotlib.colormaps['RdBu_r'] lower = plt.cm.seismic(np.ones(1)*0.50) # Original is ones upper = cmap(np.linspace(0.5, 1, 100)) colors = np.vstack((lower,upper)) @@ -603,13 +603,13 @@ def GlobalFireSpreadEvo(self, CoordCells, onlyGraph=True, version=0): divider = make_axes_locatable(ax) cax1 = divider.append_axes("right", size="5%", pad=0.15) plt.colorbar(sm, cax=cax1) - + # both savefig calls used to have figsize=(200, 200), (april 2025) plt.savefig(os.path.join(self._StatsFolder, "SpreadTree_FreqGraph_" + outname + ".png"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) if self._pdfOutputs: plt.savefig(os.path.join(self._StatsFolder, "SpreadTree_FreqGraph_" + outname + ".pdf"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) plt.close("all") @@ -638,7 +638,7 @@ def SimFireSpreadEvo(self, nSim, CoordCells, Colors, H=None, version=0, # We generate the plot if print_graph: - # plt.figure(figsize = (15, 9)) + plt.figure(figsize = (15, 9)) # ??? consider removing (April 2025) # Font sizes plt.rcParams['font.size'] = 16 @@ -681,14 +681,14 @@ def SimFireSpreadEvo(self, nSim, CoordCells, Colors, H=None, version=0, PlotPath = os.path.join(self._OutFolder, "Plots", "Plots" + str(nSim)) if os.path.isdir(PlotPath) is False: os.makedirs(PlotPath) - + # both savefig calls used to have figsize=(200, 200), (April 2025) plt.savefig(os.path.join(PlotPath, "PropagationTree" + str(nSim) +".png"), - dpi=200, figsize=(200, 200), edgecolor='b', + dpi=200, edgecolor='b', bbox_inches='tight', transparent=False) if self._pdfOutputs: plt.savefig(os.path.join(PlotPath, "PropagationTree" + str(nSim) +".pdf"), - dpi=200, figsize=(200, 200), edgecolor='b', + dpi=200, edgecolor='b', bbox_inches='tight', transparent=False) @@ -745,7 +745,7 @@ def SimFireSpreadEvoV2(self, nSim, CoordCells, Colors, H=None, version=0, onlyGr node_shape='s', node_color = Colors) - # plt.figure(figsize = (15, 9)) + plt.figure(figsize = (15, 9)) # consider removing (April 2025) # Font sizes plt.rcParams['font.size'] = 16 @@ -823,14 +823,15 @@ def SimFireSpreadEvoV2(self, nSim, CoordCells, Colors, H=None, version=0, onlyGr #ax.set_aspect('auto') divider = make_axes_locatable(ax) cax1 = divider.append_axes("right", size="5%", pad=0.05) - plt.colorbar(sm, cax=cax1) + plt.colorbar(sm, cax=cax1) + # both savefig calls used to have figsize=(200, 200), (April 2025) plt.savefig(os.path.join(PlotPath, "FireSpreadTree" + str(nSim) + "_" + str(version) + ".png"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) if self._pdfOutputs: plt.savefig(os.path.join(PlotPath, "FireSpreadTree" + str(nSim) + "_" + str(version) + ".pdf"), - dpi=200, figsize=(200, 200), + dpi=200, bbox_inches='tight', transparent=False) plt.close("all") @@ -1201,11 +1202,11 @@ def HourlyStats(self): print("Hourly Stats:\n",Ah) # Hourly Summary - SummaryDF = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')["NonBurned", "Burned", "Harvested"].mean() + SummaryDF = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')[["NonBurned", "Burned", "Harvested"]].mean() SummaryDF.rename(columns={"NonBurned":"AVGNonBurned", "Burned":"AVGBurned", "Harvested":"AVGHarvested"}, inplace=True) - SummaryDF[["STDBurned", "STDHarvested"]] = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')["Burned","Harvested"].std()[["Burned","Harvested"]] - SummaryDF[["MaxNonBurned", "MaxBurned"]] = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')["NonBurned", "Burned"].max()[["NonBurned", "Burned"]] - SummaryDF[["MinNonBurned", "MinBurned"]] = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')["NonBurned", "Burned"].min()[["NonBurned", "Burned"]] + SummaryDF[["STDBurned", "STDHarvested"]] = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')[["Burned","Harvested"]].std()[["Burned","Harvested"]] + SummaryDF[["MaxNonBurned", "MaxBurned"]] = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')[["NonBurned", "Burned"]].max()[["NonBurned", "Burned"]] + SummaryDF[["MinNonBurned", "MinBurned"]] = Ah[["NonBurned", "Burned", "Harvested", "Hour"]].groupby('Hour')[["NonBurned", "Burned"]].min()[["NonBurned", "Burned"]] Aux = (SummaryDF["AVGNonBurned"] + SummaryDF["AVGBurned"] + SummaryDF["AVGHarvested"]) SummaryDF["%AVGNonBurned"], SummaryDF["%AVGBurned"], SummaryDF["%AVGHarvested"] = SummaryDF["AVGNonBurned"] / Aux, SummaryDF["AVGBurned"] / Aux, SummaryDF["AVGHarvested"] / Aux SummaryDF.reset_index(inplace=True) diff --git a/requirements.txt b/requirements.txt index 6fb01505..6c1494fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ numpy +scipy pandas matplotlib seaborn opencv-python -imread tqdm deap sphinx_rtd_theme diff --git a/scratch/Cell2FireC_class.py b/scratch/Cell2FireC_class.py index 3908bc16..38848627 100644 --- a/scratch/Cell2FireC_class.py +++ b/scratch/Cell2FireC_class.py @@ -304,7 +304,7 @@ def stats(self): print("Generating initial forest plot...") FBPlookup = os.path.join(self.args.InFolder, "fbp_lookup_table.csv") if self.args.HCells is not None: - HCarray = np.loadtxt(self.args.HCells, skiprows=1, delimiter=",")[1:].astype(np.int) + HCarray = np.loadtxt(self.args.HCells, skiprows=1, delimiter=",")[1:].astype(int) print("HCArray:", HCarray) print("GForestN:", self._GForestN) self._GForestN = self._GForestN.flatten() @@ -410,7 +410,7 @@ def stats_Heur(self, OutFolder, HCells=None): print("Generating initial forest plot...") FBPlookup = os.path.join(self.args.InFolder, "fbp_lookup_table.csv") if HCells is not None: - HCarray = np.loadtxt(HCells, skiprows=1, delimiter=",")[1:].astype(np.int) + HCarray = np.loadtxt(HCells, skiprows=1, delimiter=",")[1:].astype(int) self._GForestN = self._GForestN.flatten() for i in HCarray: self._GForestN[i-1] = -1 @@ -618,7 +618,7 @@ def heur(self, AvailCells=set(), BurntCells=set(), HarvestedCells=set()): # Create the aux DF for saving the harvested cells in different files depending on the treated fraction % np.savetxt(os.path.join(csvPath, SelHeur + "_" +str(fr) + ".csv"), - np.asarray([1] + actions).reshape(1, len(actions) + 1).astype(np.int), + np.asarray([1] + actions).reshape(1, len(actions) + 1).astype(int), delimiter=",", fmt="%d", header="Year,HCells", comments='') step += 1 diff --git a/setup.py b/setup.py index dc986a7d..50be41b1 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ author='Cristobal Pais, Jaime Carrasco, David Martell, David L. Woodruff, Andres Weintraub', author_email='dlwoodruff@ucdavis.edu', packages=packages, - install_requires=['numpy', 'pandas', 'matplotlib', 'seaborn', 'tqdm', 'imread', 'networkx', 'deap'], + install_requires=['numpy', 'pandas', 'matplotlib', 'seaborn', 'tqdm', 'opencv-python', 'networkx', 'deap'], extras_require={ 'doc': [ 'sphinx_rtd_theme',