Skip to content

Commit

Permalink
review, please squash
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Sep 23, 2024
1 parent 4f13493 commit d6136d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/generate-morphs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Data Morph
run: |
Expand Down
20 changes: 16 additions & 4 deletions bin/ci.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
#!/usr/bin/env python
"""
Pass in the filenames that changed and it'll tell you the arguments of datasets and shapes.
See examples below
$ 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
SDS
"""
from data_morph.shapes.factory import ShapeFactory
from data_morph.data.loader import DataLoader
import sys
from inspect import getmro
from os.path import basename

new_paths = sys.argv[1:]
Expand All @@ -22,13 +34,13 @@
# Find the class and all parent classes and get their module name
# We get the module name because it ends in the python file without .py extension
# To make it easy to compare, we just add the extension onto the end
parents = [x.__module__ for x in getmro(c)]
parents = [x.__module__ for x in c.__mro__]
all_modules = parents + [c.__module__]
all_modules = [f"{x}.py" for x in all_modules]
all_modules = [f'{x}.py' for x in all_modules]

for module in all_modules:
if module.endswith(new_file):
args.append(shape)
break

print(" ".join(args))
print(' '.join(args))

0 comments on commit d6136d3

Please sign in to comment.