Skip to content

Commit

Permalink
Merge pull request #190 from gramaziokohler/compas2.0
Browse files Browse the repository at this point in the history
Compas2.0
  • Loading branch information
chenkasirer authored Feb 2, 2024
2 parents 8090234 + 100b55b commit a98bfff
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 454 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Updated COMPAS dependency to `2.0.0`!

### Removed


Expand Down
Binary file modified examples/Grasshopper/CT_NEW_UI_Example.3dm
Binary file not shown.
Binary file modified examples/Grasshopper/CT_NEW_UI_Example.gh
Binary file not shown.
18 changes: 5 additions & 13 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
attrs >=17.4
bump2version >=0.5.11
black
bump2version >=1.0.1
check-manifest >=0.36
compas_invocations
doc8
flake8
graphviz
importlib_metadata <5.0
invoke >=0.14
ipykernel
ipython >=5.8
isort
m2r
black >=24.0
nbsphinx
pydocstyle
pytest >=3.2
pytest-mock
sphinx_compas2_theme
sphinx ==7.1.2
twine
matplotlib
Rtree
compas_invocations
wheel
-e .
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rtree
compas==2.0.0beta4
compas >=2.0, <3.0
1 change: 1 addition & 0 deletions src/compas_timber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


__all_plugins__ = [
"compas_timber.ghpython.install",
"compas_timber.rhino",
"compas_timber.rhino.install",
"compas_timber.utils.r_tree",
Expand Down
85 changes: 0 additions & 85 deletions src/compas_timber/ghpython/components/install.py

This file was deleted.

Binary file not shown.
Binary file not shown.
52 changes: 52 additions & 0 deletions src/compas_timber/ghpython/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import glob
import os

import compas.plugins
from compas_ghpython.components import install_userobjects
from compas_ghpython.components import uninstall_userobjects


@compas.plugins.plugin(category="install")
def installable_rhino_packages():
return ["compas_timber"]


@compas.plugins.plugin(category="install")
def after_rhino_install(installed_packages):
if "compas_timber" not in installed_packages:
return []

installed_objects = install_userobjects(os.path.join(os.path.dirname(__file__), "components", "ghuser"))

return [
(
"compas_timber",
"Installed {} GH User Objects".format(len(installed_objects)),
True,
)
]


@compas.plugins.plugin(category="install")
def after_rhino_uninstall(uninstalled_packages):
if "compas_timber" not in uninstalled_packages:
return []

srcdir = os.path.join(os.path.dirname(__file__), "components", "ghuser")
userobjects = [os.path.basename(ghuser) for ghuser in glob.glob(os.path.join(srcdir, "*.ghuser"))]
uninstalled_objects = uninstall_userobjects(userobjects)

uninstall_errors = [uo[0] for uo in uninstalled_objects if not uo[1]]
error_msg = "" if not uninstall_errors else "and {} failed to uninstall".format(len(uninstall_errors))

return [
(
"compas_timber",
"Uninstalled {} GH User Objects {}".format(len(uninstalled_objects), error_msg),
True,
)
]
20 changes: 0 additions & 20 deletions src/compas_timber/rhino/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,3 @@
@compas.plugins.plugin(category="install")
def installable_rhino_packages():
return ["compas_timber"] # add all other dependencies that are needed and work in rhino


@compas.plugins.plugin(category="install")
def after_rhino_install(installed_packages):
if "compas_timber" not in installed_packages:
return []

import compas_timber.ghpython.components.install

return compas_timber.ghpython.components.install.install()


@compas.plugins.plugin(category="install")
def after_rhino_uninstall(installed_packages):
if "compas_timber" not in installed_packages:
return []

import compas_timber.ghpython.components.install

return compas_timber.ghpython.components.install.uninstall()
3 changes: 1 addition & 2 deletions src/compas_timber/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from .compas_extra import intersection_line_line_3D
from .compas_extra import intersection_line_plane
from .helpers import are_objects_identical
from .helpers import close


__all__ = ["intersection_line_line_3D", "intersection_line_plane", "close", "are_objects_identical"]
56 changes: 0 additions & 56 deletions src/compas_timber/utils/helpers.py

This file was deleted.

Loading

0 comments on commit a98bfff

Please sign in to comment.