Skip to content

Add marginal plots with option to revert to classic plot #79

Add marginal plots with option to revert to classic plot

Add marginal plots with option to revert to classic plot #79

Workflow file for this run

# This workflow runs Data Morph on datasets and/or shapes that have
# been added or modified.
#
# Author: Stefanie Molin, Daniel Schaefer
name: Generate Morphs
on:
pull_request:
paths:
- 'src/**'
- 'pyproject.toml'
- '.github/workflows/generate-morphs.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
generate-morphs:
name: Run Data Morph on new/altered datasets/shapes
# Just generate on one operating system (they should all be the same)
runs-on: ubuntu-latest
defaults:
run:
shell: bash -e {0}
strategy:
fail-fast: false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.x"
- name: Install Data Morph
run: |
python -m pip install --upgrade pip
python -m pip install setuptools --upgrade
python -m pip install .
# docs for this action: https://github.com/tj-actions/changed-files
- name: Get all dataset and shape files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
with:
files_yaml: |
dataset:
- src/data_morph/data/starter_shapes/*
shape:
- src/data_morph/shapes/**
# If datasets were added or changed in this PR
- name: Generate morphs from new or changed datasets
if: steps.changed-files-yaml.outputs.dataset_any_changed == 'true'
env:
DATASET_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.dataset_all_changed_files }}
run: |
echo "Detected changes to dataset(s): $DATASET_ALL_CHANGED_FILES"
DATASET_ARGS=$(python bin/ci.py $DATASET_ALL_CHANGED_FILES)
echo "Generating morphs for the following datasets: $DATASET_ARGS"
data-morph \
--start-shape $DATASET_ARGS \
--target-shape bullseye heart rectangle star slant_up \
--workers 0
# If shapes are added or modified in this PR
- name: Generate morphs from new or changed shapes
if: steps.changed-files-yaml.outputs.shape_any_changed == 'true'
env:
SHAPE_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.shape_all_changed_files }}
run: |
echo "Detected changes to shape(s): $SHAPE_ALL_CHANGED_FILES"
SHAPE_ARGS=$(python bin/ci.py $SHAPE_ALL_CHANGED_FILES)
echo "Generating morphs for the following shapes: $SHAPE_ARGS"
data-morph \
--start-shape music \
--target-shape $SHAPE_ARGS \
--workers 0
# For core code changes, we want to do a couple morphs to see if they still look ok
# Only need to run if neither of the previous two morphs ran
- name: Morph shapes with core code changes
if: steps.changed-files-yaml.outputs.dataset_any_changed != 'true' && steps.changed-files-yaml.outputs.shape_any_changed != 'true'
run: |
data-morph \
--start-shape music \
--target-shape bullseye heart star \
--workers 0
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: morphed-data-pr${{ github.event.number }}-${{ github.sha }}
path: morphed_data