Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
stefmolin authored Nov 25, 2024
1 parent 0e81876 commit 5d75823
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/generate-morphs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
pull_request:
paths-ignore:
- 'docs/**'
- 'src/tests/**'
- 'tests/**'


concurrency:
Expand All @@ -21,7 +21,7 @@ concurrency:

jobs:
build:
name: Build with Python ${{ matrix.python-version }} on ${{ matrix.os }}
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
Expand All @@ -45,7 +45,7 @@ jobs:
python -m pip install setuptools --upgrade
python -m pip install .
- name: Get all dataset files that have changed
- name: Get all dataset and shape files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
Expand All @@ -61,8 +61,7 @@ jobs:
env:
DATASET_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.dataset_all_changed_files }}
run: |
echo "One or more dataset file(s) has changed."
echo "List all the files that have changed: $DATASET_ALL_CHANGED_FILES"
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"
parallel -j0 data-morph \
Expand All @@ -76,8 +75,7 @@ jobs:
env:
SHAPE_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.shape_all_changed_files }}
run: |
echo "One or more shape file(s) has changed."
echo "List all the files that have changed: $SHAPE_ALL_CHANGED_FILES"
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 \
Expand All @@ -86,7 +84,7 @@ jobs:
# 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
- 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: |
parallel -j0 data-morph \
Expand Down
9 changes: 6 additions & 3 deletions bin/ci.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/usr/bin/env python
"""
Pass in the filenames that changed and it'll tell you the arguments of datasets and shapes.
See examples below
Call this script with the names of files that have changed to get the
datasets and shapes to test with the CLI.
Examples
--------
$ python bin/ci.py src/data_morph/shapes/circles.py
bullseye circle rings
$ python bin/ci.py src/data_morph/shapes/bases/line_collection.py
high_lines h_lines slant_down slant_up v_lines wide_lines x diamond rectangle star
python bin/ci.py src/data_morph/data/starter_shapes/superdatascience.csv
$ python bin/ci.py src/data_morph/data/starter_shapes/superdatascience.csv
SDS
"""
from data_morph.shapes.factory import ShapeFactory
Expand Down

0 comments on commit 5d75823

Please sign in to comment.