diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 1a6beff..c7d8bbd 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -43,33 +43,33 @@ jobs: name: chama_${{ matrix.python-version }}_${{ matrix.os }}.whl path: dist/chama* - #test: - # name: Import test - # needs: build - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - # os: [ubuntu-latest] - # steps: - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Download wheel - # uses: actions/download-artifact@v3 - # with: - # name: wheel - # - name: Install chama - # run: | - # python -m pip install --upgrade pip - # pip install wheel - # pip install --find-links=. chama - # - name: Import test - # run: | - # python -c "import chama" + install: + name: Import test + needs: build + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + os: [ubuntu-latest] + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Download wheel + uses: actions/download-artifact@v3 + with: + name: wheel + - name: Install chama + run: | + python -m pip install --upgrade pip + pip install wheel + pip install --find-links=. chama + - name: Import test + run: | + python -c "import chama" - create_coverage_reports: + pytest_coverage: runs-on: ${{ matrix.os }} strategy: matrix: @@ -106,8 +106,8 @@ jobs: name: coverage path: .coverage.${{ matrix.python-version }}.${{ matrix.os }} - combine_reports: - needs: [ create_coverage_reports ] + coverage_reports: + needs: [ pytest_coverage ] runs-on: ubuntu-latest steps: - name: Set up Python @@ -120,7 +120,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install coveralls - python setup.py develop + python -m pip install -e . - name: Download coverage artifacts from test matrix uses: actions/download-artifact@v3 with: @@ -151,8 +151,8 @@ jobs: name: coverage path: htmlcov - combine_reports_upload_coveralls: - needs: [ create_coverage_reports ] + coveralls: + needs: [ pytest_coverage ] runs-on: ubuntu-latest continue-on-error: true steps: diff --git a/chama/graphics.py b/chama/graphics.py index 26ac682..03cddba 100644 --- a/chama/graphics.py +++ b/chama/graphics.py @@ -13,6 +13,9 @@ try: import matplotlib.pyplot as plt from matplotlib import ticker + from matplotlib.patches import Circle + from matplotlib.collections import PatchCollection + from matplotlib.animation import FuncAnimation except: plt = None @@ -21,8 +24,8 @@ from chama.sensors import Mobile -def signal_convexhull(signal, scenarios, threshold, timesteps=None, - colormap=None, +def signal_convexhull(signal, scenarios, threshold, timesteps=None, + colormap=None, x_range=(None, None), y_range=(None, None), z_range=(None, None)): """ @@ -318,13 +321,10 @@ def circles(x, y, s, c='b', vmin=None, vmax=None, **kwargs): if plt is None: raise ImportError('matplotlib is required for graphics') + buffer = puff['sigmaY'].max() + puff['sigmaY'].max()/5 x_range = (puff['X'].min() - buffer, puff['X'].max() + buffer) y_range = (puff['Y'].min() - buffer, puff['Y'].max() + buffer) - - from matplotlib.patches import Circle, Ellipse, Rectangle - from matplotlib.collections import PatchCollection - from matplotlib.animation import FuncAnimation, FFMpegWriter fig, ax = plt.subplots() # ln, = plt.plot([],[],animated=True)