Skip to content

Commit

Permalink
Merge pull request #12 from secorolab/add-black-gh-action
Browse files Browse the repository at this point in the history
Add GitHub actions
  • Loading branch information
Samuel-Wiest authored Jun 20, 2024
2 parents d73adfd + 1394aec commit e689d68
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 216 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint

on: [push, workflow_call]

jobs:
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "./src"
use_pyproject: true
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Continuous Integration

on: [pull_request]

jobs:
install:
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install blender
run: |
sudo apt-get update
sudo apt-get install blender python3-pip python3-venv -y
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Generate composable models
run: |
textx generate models/examples/*.floorplan --target json-ld --output-path .
- name: Generate 3D mesh and occupancy grid
working-directory: ./src
run: |
blender --background --python-use-system-env --python exsce_floorplan/exsce_floorplan.py -- ../models/examples/brsu_building_c_with_doorways.floorplan
lint:
uses: ./.github/workflows/black.yaml
212 changes: 0 additions & 212 deletions models/examples/stress.floorplan

This file was deleted.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ classifiers = [
]

[project.optional-dependencies]
dev =["wheel", "twine"]
dev =["wheel", "twine", "black>=24.4.2"]
test =[
"flake8",
"tox",
Expand All @@ -69,3 +69,6 @@ where = ["src"] # list of folders that contain the packages (["."] by default)

[tool.setuptools.package-data]
"*" = ["*.tx"]

[tool.black]
required-version = "24.4.2"
2 changes: 1 addition & 1 deletion src/exsce_floorplan/floor_plan/processors/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def unique_names_processor(floorplan):
else:
raise TextXSemanticError(
"Spaces and features must have unique names",
**get_location(feature)
**get_location(feature),
)

for opening in floorplan.wall_openings:
Expand Down
4 changes: 2 additions & 2 deletions src/exsce_floorplan/variation/exsce_variations.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ def new_sample(fp_model, var_model):
if not hasattr(obj.value, "value"):
raise TextXSemanticError(
"Semantic Error: This attribute is originally set by a variable.",
**get_location(att)
**get_location(att),
)
elif (
obj is fp_model["Default.WallThickness"]
or obj is fp_model["Default.WallHeight"]
):
raise TextXSemanticError(
"Semantic Error: This attribute must set in the original model.",
**get_location(att)
**get_location(att),
)

obj.value.value = att.distribution.sample()
Expand Down

0 comments on commit e689d68

Please sign in to comment.