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 .github/workflows/expl_heuristic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: expl_heuristic # Kotaro Yama
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fullstat_allplot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: fullstat_allplot # Kotaro Yama
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sub20x20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: sub20x20 # Test2_zonghan
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testReadme1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Test First Readme Example
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_datagenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: test_datagenerator
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_dogrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: dogrib
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_h1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: test_h1 # Kotaro Yama
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_h2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: test_h2 # Kotaro Yama
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_h3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: test_h3 # Kotaro Yama
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_randweather.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: randweather
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_readspot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: test_readspot
on:
workflow_dispatch:
push:
branches: [main, bitrot]
branches: [main]
pull_request:
branches: [main, bitrot]
branches: [main]

defaults:
run:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/test_spread_radius.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: test_spread_radius

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

defaults:
run:
shell: bash -l {0}

jobs:
build:
name: test_spread_radius
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PYTHONPATH: ${{ github.workspace }}
steps:
- 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
pip install pytest

- name: setup the program
run: |
pip install -e .

- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: run tests
run: |
cd tests
pytest test_spread_radius.py
14 changes: 7 additions & 7 deletions cell2fire/Cell2FireC/Cell2Fire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void Cell2Fire::InitCell(int id){
it2 = this->Cells_Obj.find(id);

// Initialize the fire fields for the selected cel
it2->second.initializeFireFields(this->coordCells, this->availCells);
it2->second.initializeFireFields(this->coordCells, this->availCells, this->rows, this->cols, this->args.SpreadRadius);

// Print info for debugging
if (this->args.verbose) it2->second.print_info();
Expand Down Expand Up @@ -992,14 +992,14 @@ void Cell2Fire::GetMessages(std::unordered_map<int, std::vector<int>> sendMessag
burntList.insert(it->second.realId);

// Cleaning step
int cellNum = it->second.realId - 1;
for (auto & angle : it->second.angleToNb) {
int origToNew = angle.first;
int newToOrig = (origToNew + 180) % 360;
int adjCellNum = angle.second; // Check
for (auto & nbAndAngle : it->second.angleDict) {
int adjCellNum = nbAndAngle.first;
auto adjIt = Cells_Obj.find(adjCellNum);
if (adjIt != Cells_Obj.end()) {
adjIt->second.ROSAngleDir.erase(newToOrig);
adjIt->second.ROSAngleDir.erase(it->second.realId);
adjIt->second.fireProgress.erase(it->second.realId);
adjIt->second.angleDict.erase(it->second.realId);
adjIt->second.distToCenter.erase(it->second.realId);
}
}
}
Expand Down
Loading
Loading