From 3f0940c751862d87d5d7320c8a712bc98f708e41 Mon Sep 17 00:00:00 2001 From: tetov Date: Fri, 14 Feb 2020 12:44:01 +0100 Subject: [PATCH] Prepare new version --- .travis.yml | 7 ++++++ CHANGELOG.md | 11 ++++---- docs/api/compas_rcf.abb.rst | 6 ----- docs/api/compas_rcf.fabrication.rst | 6 ----- docs/api/compas_rcf.ur.rst | 6 ----- docs/api/compas_rcf.utils.rst | 6 ----- docs/conf.py | 2 +- .../create_bullets_read_write_json.rst | 10 +++++--- docs/index.rst | 25 +++++++++++++++++++ docs/{api.rst => reference.rst} | 7 ++---- docs/reference/compas_rcf.rst | 2 ++ pyproject.toml | 1 - src/compas_rcf/__init__.py | 6 +---- src/compas_rcf/abb/__init__.py | 3 --- src/compas_rcf/fabrication/__init__.py | 8 +----- .../{abb_rcf_runner.py => abb_runner.py} | 6 +++-- src/compas_rcf/fabrication/clay_obj.py | 2 ++ src/compas_rcf/fabrication/conf.py | 19 ++------------ src/compas_rcf/fabrication/network.py | 2 ++ .../ur_fabrication_non_interactive.py | 2 ++ src/compas_rcf/ur/__init__.py | 3 --- src/compas_rcf/ur/visualize_urscript.py | 2 ++ src/compas_rcf/utils/__init__.py | 8 ++---- src/compas_rcf/utils/json_.py | 4 ++- src/compas_rcf/utils/ui.py | 2 ++ 25 files changed, 71 insertions(+), 85 deletions(-) delete mode 100644 docs/api/compas_rcf.abb.rst delete mode 100644 docs/api/compas_rcf.fabrication.rst delete mode 100644 docs/api/compas_rcf.ur.rst delete mode 100644 docs/api/compas_rcf.utils.rst rename docs/{api.rst => reference.rst} (61%) create mode 100644 docs/reference/compas_rcf.rst rename src/compas_rcf/fabrication/{abb_rcf_runner.py => abb_runner.py} (98%) diff --git a/.travis.yml b/.travis.yml index 5ea3b369..dba42719 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,4 +39,11 @@ deploy: skip_cleanup: true on: tags: true + - provider: releases + skip_cleanup: true + api-key: $GITHUB_TOKEN + file_glob: true + file: dist/* + on: + tags: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a450c95..2b398e74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased - -### Added +## \[0.1.13\] \[2020-10-14\] ### Changed -- Fixes for tkinter file dialog in `compas_rcf.utils.ui` - -### Removed +- `compas_rcf.fabrication.abb_rcf_runner` renamed to `compas_rcf.fabrication.abb_runner`. +- Typos in `abb_runner` fixed. +- Trying to set up imports better between modules +- Fixes for tkinter file dialog in `compas_rcf.utils.ui`. ## \[0.1.12\] \[2020-10-13\] diff --git a/docs/api/compas_rcf.abb.rst b/docs/api/compas_rcf.abb.rst deleted file mode 100644 index dcd5fd08..00000000 --- a/docs/api/compas_rcf.abb.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. rst-class:: detail - -compas_rcf.abb -============== - -.. automodule:: compas_rcf.abb diff --git a/docs/api/compas_rcf.fabrication.rst b/docs/api/compas_rcf.fabrication.rst deleted file mode 100644 index 56e123b6..00000000 --- a/docs/api/compas_rcf.fabrication.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. rst-class:: detail - -compas_rcf.fabrication -====================== - -.. automodule:: compas_rcf.fabrication diff --git a/docs/api/compas_rcf.ur.rst b/docs/api/compas_rcf.ur.rst deleted file mode 100644 index 4e4a4526..00000000 --- a/docs/api/compas_rcf.ur.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. rst-class:: detail - -compas_rcf.ur -============= - -.. automodule:: compas_rcf.ur diff --git a/docs/api/compas_rcf.utils.rst b/docs/api/compas_rcf.utils.rst deleted file mode 100644 index 3274d8c9..00000000 --- a/docs/api/compas_rcf.utils.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. rst-class:: detail - -compas_rcf.utils -================ - -.. automodule:: compas_rcf.utils diff --git a/docs/conf.py b/docs/conf.py index 75a102c4..451844f7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,6 +34,7 @@ "sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.doctest", + 'sphinx.ext.extlinks', "sphinx.ext.intersphinx", "sphinx.ext.mathjax", "sphinx.ext.napoleon", @@ -60,7 +61,6 @@ # autosummary options autosummary_generate = True -autosummary_imported_members = True # napoleon options diff --git a/docs/examples/create_bullets_read_write_json.rst b/docs/examples/create_bullets_read_write_json.rst index 997785e9..cbc0fdf9 100644 --- a/docs/examples/create_bullets_read_write_json.rst +++ b/docs/examples/create_bullets_read_write_json.rst @@ -1,13 +1,15 @@ +******************************************************************************* ClayBullet object creator and JSON read & write -================================== +******************************************************************************* -Found :download:`here <./create_bullets_read_write_json.gh>`. +.. note + Found :download:`here <./create_bullets_read_write_json.gh>`. Requires ``compas_rcf`` installed and available from inside Rhino. Follow the -installation steps in the :doc:`../getting_started.rst`. +installation steps in the :doc:`../getting_started`. Includes -------- -- Components to create :class:compas_rcf.fabrication.ClayBullet objects as +- Components to create :class:`compas_rcf.fabrication.ClayBullet` objects as well as reading and writing them to a json file diff --git a/docs/index.rst b/docs/index.rst index 20278d16..dd0b9965 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,6 +2,27 @@ compas_rcf ******************************************************************************** +python module for MAS DFAB project Rapid Clay Formations + +COMPAS +====== + +compas_rcf is part is built on top of `compas`_, `compas_fab`_ and +`compas_rrc`_. + +Note on compatibility +===================== + +Installation of the package requires Python \>\= 3.6. + +Big parts are compatible with IronPython 2.7 (to be run inside Rhino plugin +Grasshopper). + +The modules that require Python \>\= 3.6 should raise an exception on import. + +Documentation +============= + .. toctree:: :maxdepth: 3 :titlesonly: @@ -13,3 +34,7 @@ compas_rcf changelog authors license + +.. _`compas`: https://compas-dev.github.io/ +.. _`compas_fab`: https://gramaziokohler.github.io/compas_fab/ +.. _`compas_rrc`: https://bitbucket.org/ethrfl/compas_rrc/ diff --git a/docs/api.rst b/docs/reference.rst similarity index 61% rename from docs/api.rst rename to docs/reference.rst index 29fac740..ed54ca7d 100644 --- a/docs/api.rst +++ b/docs/reference.rst @@ -3,10 +3,7 @@ API Reference ******************************************************************************** .. toctree:: - :maxdepth: 1 + :maxdepth: 2 - api/compas_rcf.abb - api/compas_rcf.fabrication - api/compas_rcf.ur - api/compas_rcf.utils + reference/compas_rcf diff --git a/docs/reference/compas_rcf.rst b/docs/reference/compas_rcf.rst new file mode 100644 index 00000000..eeac092e --- /dev/null +++ b/docs/reference/compas_rcf.rst @@ -0,0 +1,2 @@ +.. automodule:: compas_rcf + :members: diff --git a/pyproject.toml b/pyproject.toml index 7218a9b4..22433ebe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ known_first_party = "compas_rcf" known_third_party = "compas,compas_fab,compas_rrc,Rhino" default_section = "THIRDPARTY" forced_separate = "test_compas" -not_skip = "__init__.py" add_imports = "__future__.absolute_import,__future__.division,__future__.print_function" force_adds = true skip = "_version.py" diff --git a/src/compas_rcf/__init__.py b/src/compas_rcf/__init__.py index 237153d7..22ff2c5b 100644 --- a/src/compas_rcf/__init__.py +++ b/src/compas_rcf/__init__.py @@ -8,10 +8,6 @@ python module for MAS DFAB project Rapid Clay Formations """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import os HERE = os.path.dirname(__file__) @@ -41,4 +37,4 @@ __license__ = "MIT License" __email__ = "anton@tetov.se" -__all__ = ["HOME", "DATA", "DOCS", "TEMP"] +__all__ = ["HOME", "DATA", "DOCS", "TEMP", "__version__"] diff --git a/src/compas_rcf/abb/__init__.py b/src/compas_rcf/abb/__init__.py index 6c9a0c22..a511d133 100644 --- a/src/compas_rcf/abb/__init__.py +++ b/src/compas_rcf/abb/__init__.py @@ -11,6 +11,3 @@ This package should be used for any helpers or utilities we might require. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function diff --git a/src/compas_rcf/fabrication/__init__.py b/src/compas_rcf/fabrication/__init__.py index 49ab2610..f1b208de 100644 --- a/src/compas_rcf/fabrication/__init__.py +++ b/src/compas_rcf/fabrication/__init__.py @@ -11,11 +11,5 @@ digital fabrication method. It also contains fabrication objects, most significantly :class:`compas_rcf.fabrication.ClayBullet` which is our data representation of our discrete building blocks. -""" - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from .clay_obj import * # noqa: F401,F403 -from .network import * # noqa: F401,F403 +""" diff --git a/src/compas_rcf/fabrication/abb_rcf_runner.py b/src/compas_rcf/fabrication/abb_runner.py similarity index 98% rename from src/compas_rcf/fabrication/abb_rcf_runner.py rename to src/compas_rcf/fabrication/abb_runner.py index 1ca0831f..ad183909 100644 --- a/src/compas_rcf/fabrication/abb_rcf_runner.py +++ b/src/compas_rcf/fabrication/abb_runner.py @@ -84,7 +84,7 @@ def send_grip_release(client, do_state): do_state : int (0 or 1) Value to set DO to """ - if CONF.is_target_real: + if CONF.target == "real": client.send(WaitTime(CONF.tool.wait_before_io)) client.send(SetDigital(CONF.tool.io_needles_pin, do_state)) client.send(WaitTime(CONF.tool.wait_after_io)) @@ -123,7 +123,9 @@ def initial_setup(client): logging.debug("Acceleration values set.") # Set Max Speed - client.send(SetMaxSpeed(CONF.speed.speed_override, CONF.speed.speed_max_tcp)) + client.send( + SetMaxSpeed(CONF.speed_values.speed_override, CONF.speed_values.speed_max_tcp) + ) logging.debug("Speed set.") # Initial configuration diff --git a/src/compas_rcf/fabrication/clay_obj.py b/src/compas_rcf/fabrication/clay_obj.py index 158382dd..b03d85a4 100755 --- a/src/compas_rcf/fabrication/clay_obj.py +++ b/src/compas_rcf/fabrication/clay_obj.py @@ -20,6 +20,8 @@ if IPY: import Rhino.Geometry as rg +__all__ = ["ClayBullet", "check_id_collision"] + class ClayBullet(object): """Simple Clay Cylinder. diff --git a/src/compas_rcf/fabrication/conf.py b/src/compas_rcf/fabrication/conf.py index 3604e35f..eb05f718 100644 --- a/src/compas_rcf/fabrication/conf.py +++ b/src/compas_rcf/fabrication/conf.py @@ -6,6 +6,8 @@ from compas_rcf.abb.helpers import zone_dict +__all__ = ["ZoneDataTemplate", "abb_rcf_conf_template", "fabrication_conf"] + class ZoneDataTemplate(confuse.Template): def __init__(self, default=confuse.REQUIRED): @@ -60,21 +62,4 @@ def convert(self, value, view): }, } - -def get_numerical_zone_value(zone_data): - """Take input and return numerical zone data. - - Parameters - ---------- - zone_value : str, float or int - Either zone data in mm or one of RAPID's defined variable names for zone data - - Returns - ------- - float or int - zone data in mm - """ - return zone_dict[zone_data.upper()] - - fabrication_conf = confuse.LazyConfig("FabricationRunner", __name__) diff --git a/src/compas_rcf/fabrication/network.py b/src/compas_rcf/fabrication/network.py index 042a2c1e..88f8b8d1 100644 --- a/src/compas_rcf/fabrication/network.py +++ b/src/compas_rcf/fabrication/network.py @@ -4,6 +4,8 @@ from compas.datastructures import Network +__all__ = ["ClayStructure"] + class ClayStructure(Network): def __init__(self, clay_bullets): diff --git a/src/compas_rcf/fabrication/ur_fabrication_non_interactive.py b/src/compas_rcf/fabrication/ur_fabrication_non_interactive.py index 0e698431..ee077f02 100644 --- a/src/compas_rcf/fabrication/ur_fabrication_non_interactive.py +++ b/src/compas_rcf/fabrication/ur_fabrication_non_interactive.py @@ -11,6 +11,8 @@ from compas_rcf.ur.visualize_urscript import visualize_urscript from compas_rcf.utils.util_funcs import list_elem_w_index_wrap +__all__ = ["ur_clay_shooting"] + # UR movement ROBOT_L_SPEED = 0.6 # m/s ROBOT_ACCEL = 0.8 # m/s2 diff --git a/src/compas_rcf/ur/__init__.py b/src/compas_rcf/ur/__init__.py index 1f080be8..c7dd0e59 100644 --- a/src/compas_rcf/ur/__init__.py +++ b/src/compas_rcf/ur/__init__.py @@ -10,6 +10,3 @@ for fabrication. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function diff --git a/src/compas_rcf/ur/visualize_urscript.py b/src/compas_rcf/ur/visualize_urscript.py index 0bd40efa..3d6922c7 100644 --- a/src/compas_rcf/ur/visualize_urscript.py +++ b/src/compas_rcf/ur/visualize_urscript.py @@ -14,6 +14,8 @@ from compas_rcf.utils.compas_to_rhino import cgframe_to_rgplane from compas_rcf.utils.compas_to_rhino import matrix_to_rgtransform +__all__ = ["visualize_urscript"] + def visualize_urscript(script): M = [ diff --git a/src/compas_rcf/utils/__init__.py b/src/compas_rcf/utils/__init__.py index 7957bc20..0c8792a4 100644 --- a/src/compas_rcf/utils/__init__.py +++ b/src/compas_rcf/utils/__init__.py @@ -22,9 +22,5 @@ """ - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - -from .util_funcs import * # noqa: F401,F403 +from compas_rcf.utils.json_ import * # noqa F401,F403 +from compas_rcf.utils.util_funcs import * # noqa F401,F403 diff --git a/src/compas_rcf/utils/json_.py b/src/compas_rcf/utils/json_.py index b945461b..8c261348 100644 --- a/src/compas_rcf/utils/json_.py +++ b/src/compas_rcf/utils/json_.py @@ -4,7 +4,9 @@ import json -from compas_rcf.fabrication import ClayBullet +from compas_rcf.fabrication.clay_obj import ClayBullet + +all = ["load_bullets"] def load_bullets(file_path): diff --git a/src/compas_rcf/utils/ui.py b/src/compas_rcf/utils/ui.py index 4943dce2..3d75a087 100644 --- a/src/compas_rcf/utils/ui.py +++ b/src/compas_rcf/utils/ui.py @@ -12,6 +12,8 @@ from colorama import init from confuse import ConfigTypeError +__all__ = ["open_file_dialog", "print_conf_w_colors", "clear_screen"] + root = Tk() root.withdraw()