From e8c3a4f85f4ed7120c8b29c6535ef81ce32a02ce Mon Sep 17 00:00:00 2001 From: Gavin Burnell Date: Wed, 30 Oct 2024 13:59:09 +0000 Subject: [PATCH] Remove some deprication warnings and try to twqeak testing github action --- .github/workflows/run-tests-action.yaml | 23 +++++++++++++---------- Stoner/Image/widgets.py | 4 ++-- Stoner/tools/widgets.py | 2 +- tests/test-env.yml | 1 + 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run-tests-action.yaml b/.github/workflows/run-tests-action.yaml index 3d4d2ece2..4571e0ebe 100755 --- a/.github/workflows/run-tests-action.yaml +++ b/.github/workflows/run-tests-action.yaml @@ -14,21 +14,24 @@ jobs: os: ["ubuntu-latest"] steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Conda environment with Micromamba - uses: mamba-org/setup-micromamba@v1 + uses: conda-incubator/setup-miniconda@v3 with: environment-file: tests/test-env.yml - extra-specs: | - python=${{ matrix.python-version }} - channels: phygbu, conda-forge + python: ${{ matrix.python-version }} + channels: conda-forge,phygbu + allow-softlinks: true channel-priority: flexible - - name: Conda info - run: ${MAMBA_EXE} info - - name: Conda list - run: ${MAMBA_EXE} list + show-channel-urls: true + run: | + conda info + conda list + conda config --show-sources + conda config --show + conda activate test-environment - name: install package - run: ${MAMBA_ROOT_PREFIX}/envs/test-environment/bin/pip install --no-deps . + run: pip install --no-deps . - name: Install headless server run: | sudo apt-get install xvfb diff --git a/Stoner/Image/widgets.py b/Stoner/Image/widgets.py index ab625e7cb..f7596b135 100755 --- a/Stoner/Image/widgets.py +++ b/Stoner/Image/widgets.py @@ -343,7 +343,7 @@ def keypress(self, event): plt.title(getattr(getattr(self, f"draw_{self.obj}", ""), "instructions", "")) return self.draw(event) if event.key.lower() == "i": - self.invert = ~self.invert + self.invert = not self.invert return self.draw(event) if event.key.lower() == "enter": self.vertices.append((event.xdata, event.ydata)) @@ -524,5 +524,5 @@ def get_mask(self): vertices = np.array(self.vertices) meth = getattr(self, f"draw_{self.obj}", lambda x: ([], [])) rr, cc = meth(vertices) - mask[rr, cc] = ~self.invert + mask[rr, cc] = not self.invert return mask diff --git a/Stoner/tools/widgets.py b/Stoner/tools/widgets.py index b050a23c6..b23012cc2 100755 --- a/Stoner/tools/widgets.py +++ b/Stoner/tools/widgets.py @@ -230,7 +230,7 @@ def keypress(self, event): self.ax.patches[-1].remove() self.data.fig.canvas.draw() elif event.key.lower() == "i": # Invert selection - self.invert = ~self.invert + self.invert = not self.invert col = "red" if self.invert else "green" for p in self.ax.patches: p.update({"color": col, "facecolor": col}) diff --git a/tests/test-env.yml b/tests/test-env.yml index 316d88874..1ef2a7ce7 100755 --- a/tests/test-env.yml +++ b/tests/test-env.yml @@ -32,3 +32,4 @@ dependencies: - statsmodels - tabulate - urllib3 + - pip