From 25a876c7fc7eff73c30aa435fe4e36349c7df81d Mon Sep 17 00:00:00 2001 From: Aaron Saxton Date: Mon, 20 May 2024 10:30:26 -0500 Subject: [PATCH 1/3] Unrolling brocast --- src/grading.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/grading.py b/src/grading.py index 987211d..a482f40 100644 --- a/src/grading.py +++ b/src/grading.py @@ -26,10 +26,17 @@ def grade_poly_raster(pred_image, true_image, feedback_image=None): return (0, 0, 0, 0, feedback_image) if feedback_image is not None: - feedback_image[(true_image>=1).all(-1)] = MISS_COLOR - feedback_image[(pred_image>=1).all(-1)] = FAIL_COLOR - feedback_image[(intersection==1).all(-1)] = CORRECT_COLOR - + feedback_image[0][(true_image>=1)[0]] = MISS_COLOR[0] + feedback_image[1][(true_image>=1)[0]] = MISS_COLOR[1] + feedback_image[2][(true_image>=1)[0]] = MISS_COLOR[2] + feedback_image[0][(pred_image>=1)[0]] = FAIL_COLOR[0] + feedback_image[1][(pred_image>=1)[0]] = FAIL_COLOR[1] + feedback_image[2][(pred_image>=1)[0]] = FAIL_COLOR[2] + feedback_image[0][(intersection==1)[0]] = CORRECT_COLOR[0] + feedback_image[1][(intersection==1)[0]] = CORRECT_COLOR[1] + feedback_image[2][(intersection==1)[0]] = CORRECT_COLOR[2] + + #raise Exception(f"feedback Dim {type((true_image>=1))}\n{(true_image>=1).shape}\n {type(feedback_image)} \n{feedback_image[0].shape}") recall = true_positive / np.count_nonzero(true_image) precision = true_positive / np.count_nonzero(pred_image) @@ -230,4 +237,4 @@ def detect_difficult_pixels(map_image, true_image, lgd_pts, set_false_as='hard') # the outside pixels will be deemed easy! hard_pixel_mask=pred_by_color - return hard_pixel_mask \ No newline at end of file + return hard_pixel_mask From 35ac205f39a9a4ac13d651ab90874468e121445f Mon Sep 17 00:00:00 2001 From: Aaron Saxton Date: Wed, 22 May 2024 16:51:03 -0500 Subject: [PATCH 2/3] testing submodule commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 540ae4b..054984c 100644 --- a/README.md +++ b/README.md @@ -69,4 +69,4 @@ Example of a validation image from a UIUC model run on AR_StJoe_Mbs_poly Flag to enable the saving of debugging feedback images. ## Authors and acknowledgment -This repo was created by and is maintained by the UIUC team. +This repo was created by and is maintained by the amazing UIUC team. From 3bb8baf1e41193c2636fd063c21e0ab8309d158c Mon Sep 17 00:00:00 2001 From: abodeuis <54557445+abodeuis@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:45:47 -0500 Subject: [PATCH 3/3] Created pytest.yml --- .github/workflows/pytest.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..efa70a1 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,34 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Pytest + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + python-version: ["3.10.14", "3.11.7"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with pytest + run: | + pytest tests