diff --git a/.github/workflows/deploy-examples.yml b/.github/workflows/ci-workflows.yml similarity index 54% rename from .github/workflows/deploy-examples.yml rename to .github/workflows/ci-workflows.yml index 75b87bc..71116f2 100644 --- a/.github/workflows/deploy-examples.yml +++ b/.github/workflows/ci-workflows.yml @@ -1,15 +1,26 @@ -name: Deploy Examples +name: CI Workflows on: push: branches: master + pull_request: permissions: contents: write jobs: - deploy: + + initial_checks: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + coverage: false + envs: | + # Code style + - linux: codestyle + + deploy-examples: + if: github.event_name != "pull_request" runs-on: ubuntu-latest steps: - name: Checkout diff --git a/glue_ar/__init__.py b/glue_ar/__init__.py index 992fba0..ea5f64e 100644 --- a/glue_ar/__init__.py +++ b/glue_ar/__init__.py @@ -1,11 +1,10 @@ -from glue_ar.export_scatter import * -from glue_ar.export_volume import * -from glue_ar.tools import * +from glue_ar.export_scatter import * # noqa +from glue_ar.export_volume import * # noqa +from glue_ar.tools import * # noqa def setup(): - from glue_qt.config import qt_client - + from glue_vispy_viewers.scatter.scatter_viewer import VispyScatterViewer VispyScatterViewer.tools += ["ar"] VispyScatterViewer.subtools = { diff --git a/glue_ar/common.py b/glue_ar/common.py index 8835201..8cc06f8 100644 --- a/glue_ar/common.py +++ b/glue_ar/common.py @@ -1,9 +1,10 @@ import pyvista as pv + def layers_info(info_creator, viewer_state, layer_states=None): info = {} if layer_states is None: - layer_states = list((l for l in viewer_state.layers if l.visible)) + layer_states = list((layer for layer in viewer_state.layers if layer.visible)) for layer_state in layer_states: info[layer_state.layer.uuid] = info_creator(viewer_state, layer_state) @@ -22,7 +23,7 @@ def create_plotter(adder, info_creator, viewer_state, layer_states=None): # The only error so far I've seen is a ValueError when using Plotter.add_mesh if # the mesh is empty (n_arrays = 0). We can be more explicit once our code is more definite - except: + except Exception: pass return plotter diff --git a/glue_ar/export.py b/glue_ar/export.py index 5804a78..ad5e8be 100644 --- a/glue_ar/export.py +++ b/glue_ar/export.py @@ -5,7 +5,9 @@ import pyvista as pv from gltflib.gltf import GLTF -GLTF_PIPELINE_FILEPATH = join(dirname(abspath(__file__)), "js", "node_modules", "gltf-pipeline", "bin", "gltf-pipeline.js") +GLTF_PIPELINE_FILEPATH = join(dirname(abspath(__file__)), "js", + "node_modules", "gltf-pipeline", + "bin", "gltf-pipeline.js") def export_meshes(meshes, output_path): @@ -63,16 +65,17 @@ def export_gl(plotter, filepath, with_alpha=True, compress=True): def export_modelviewer(output_path, gltf_path, alt_text): + mv_url = "https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js" html = f"""
- +