Skip to content

Commit

Permalink
Merge pull request #1 from specklesystems/kate/speed_improvements
Browse files Browse the repository at this point in the history
Kate/speed improvements
  • Loading branch information
KatKatKateryna authored Nov 11, 2023
2 parents ff4e8cb + fd7655c commit 6e274a3
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
python main.py generate_schema ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }}
- name: Speckle Automate Function - Build and Publish
uses: specklesystems/[email protected].1
uses: specklesystems/[email protected].2
with:
speckle_automate_url: ${{ env.SPECKLE_AUTOMATE_URL || 'https://automate.speckle.dev' }}
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }}
Expand Down
12 changes: 8 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from utils.utils_osm import get_buildings, get_roads
from utils.utils_other import RESULT_BRANCH
from utils.utils_png import create_image_from_bbox
from utils.utils_server import query_version_info


class FunctionInputs(AutomateBase):
Expand Down Expand Up @@ -56,11 +57,12 @@ def automate_function(
"""
# the context provides a conveniet way, to receive the triggering version
try:
base = automate_context.receive_version()

projInfo = base["info"]
projInfo = query_version_info(automate_context)
if not projInfo.speckle_type.endswith("Revit.ProjectInfo"):
automate_context.mark_run_failed("Not a valid 'Revit.ProjectInfo' provided")
automate_context.mark_run_failed(
"Not a valid 'Revit.ProjectInfo' provided"
)

lon = np.rad2deg(projInfo["longitude"])
lat = np.rad2deg(projInfo["latitude"])
Expand All @@ -86,6 +88,7 @@ def automate_function(
source_data="© OpenStreetMap",
source_url="https://www.openstreetmap.org/",
)
r'''
roads_line_layer = Collection(
elements=roads_lines,
units="m",
Expand All @@ -94,6 +97,7 @@ def automate_function(
source_data="© OpenStreetMap",
source_url="https://www.openstreetmap.org/",
)
'''
roads_mesh_layer = Collection(
elements=roads_meshes,
units="m",
Expand All @@ -105,7 +109,7 @@ def automate_function(

# add layers to a commit Collection object
commit_obj = Collection(
elements=[building_layer, roads_line_layer, roads_mesh_layer],
elements=[building_layer, roads_mesh_layer],
units="m",
name="Context",
collectionType="ContextLayer",
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ packages = [{include = "src/speckle_automate_py"}]

[tool.poetry.dependencies]
python = "^3.11"
specklepy = "2.17.9"
specklepy = "2.17.10"
pyproj = "^3.6.1"
shapely = "^2.0.2"
pypng = "^0.20220715.0"
Expand Down
Loading

0 comments on commit 6e274a3

Please sign in to comment.