Skip to content

Commit

Permalink
build(release): merge branch develop (release 0.1.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Jun 9, 2021
2 parents ffe2972 + 3c7e574 commit 0c8bd58
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 13 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
name: "tagged-release"
name: "release-notes"

on:
push:
tags:
- "*"

jobs:
tagged-release:
name: "Tagged Release"
release-notes:
name: "Regex Filtered Release Notes"
runs-on: "ubuntu-latest"

steps:

- name: "Build & test"
run: |
echo "done!"
- uses: "marvinpinto/action-automatic-releases@v1.2.0"
- uses: "marcantondahmen/release-notes-action@master"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: false
filter: "^(feat|fix)"
strict: true
43 changes: 43 additions & 0 deletions bin/finish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Run this script on a feature, bugfix or refactoring branch to squash and merge changes to develop.

# Change to the base directory of the repository.
dir=$(dirname "$0")
cd "$dir/.."

branch=$(git branch | egrep -v "(master|develop)" | grep \* | sed "s|\* ||")

if [[ ! $branch ]]
then
echo "You are not on a feature, bugfix or refactor branch!"
exit 0
fi

if [[ $(git status -s) ]]
then
echo "Working directory is not clean!"
git status -s
exit 0
fi

while true
do
read -n 1 -p "Finish $branch? (y/n) " option
case $option in
[Yy]* )
break
;;
[Nn]* )
exit 0
;;
* )
echo "Please only enter \"y\" or \"n\"."
;;
esac
done

msg="$( echo $branch | sed -E 's|([^/]+)/([^/]+)/(.*)|\1(\2): \3|' | sed 's|_| |g' )"

git checkout develop
git merge $branch --no-ff -m "$msg" && git branch --delete $branch
57 changes: 57 additions & 0 deletions bin/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Run this script to checkout develop and start a fresh feature, bugfix or refactor branch.

# Change to the base directory of the repository.
dir=$(dirname "$0")
cd "$dir/.."

if [[ $(git status -s) ]]
then
echo "Working directory is not clean!"
git status -s
exit 0
fi

git checkout develop

echo "Choose type of branch:"
echo
echo " 1) Feature (default)"
echo " 2) Bugfix"
echo " 3) Refactor"
echo
read -n 1 -p "Please select a number or press Enter for a Feature: " option
echo

case $option in
1) branchType="feat";;
2) branchType="fix";;
3) branchType="refactor";;
*) branchType="feat";;
esac

read -p "Please enter a scope: " branchScope

read -p "Please enter a name: " branchName

branch="$branchType/$branchScope/$( echo $branchName | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g' )"

while true
do
read -n 1 -p "Create $branch? (y/n) " option
case $option in
[Yy]* )
break
;;
[Nn]* )
exit 0
;;
* )
echo "Please only enter \"y\" or \"n\"."
;;
esac
done

git branch $branch
git checkout $branch
3 changes: 2 additions & 1 deletion docs/source/_static/revitron.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/source/revitron.geometry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
revitron.geometry
=================

.. automodule:: revitron.geometry
:members:
:undoc-members:
:inherited-members:
:show-inheritance:
:autosummary:
1 change: 1 addition & 0 deletions docs/source/revitron.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Submodules
revitron.externalreference
revitron.failure
revitron.filter
revitron.geometry
revitron.link
revitron.parameter
revitron.raytrace
Expand Down
3 changes: 2 additions & 1 deletion revitron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
from revitron.externalreference import *
from revitron.failure import *
from revitron.filter import *
from revitron.geometry import *
from revitron.link import *
from revitron.parameter import *
from revitron.raytrace import *
Expand All @@ -119,7 +120,7 @@
DB = Autodesk.Revit.DB
LIB_DIR = parent(parent(__file__))
REVIT_VERSION = pyrevit.HOST_APP.uiapp.Application.VersionNumber
REVITRON_VERSION = '0.1.1'
REVITRON_VERSION = '0.1.2'


def _(element):
Expand Down
13 changes: 12 additions & 1 deletion revitron/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,18 @@ def getFromType(self, paramName):
except:
return ''



def getGeometry(self):
"""
Return the Revitron Geometry instance for this element.
Returns:
object: A Revitron Geometry object
"""
import revitron
return revitron.Geometry(self._element)


def getParameter(self, paramName):
"""
Returns a parameter object.
Expand Down
59 changes: 59 additions & 0 deletions revitron/geometry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""
The Geometry submodule and its ``Geometry`` class contain useful helpers for handling
**Revit** element geometries. Note that it is possible to use the ``_()`` shorthand to get
the geometry of an element as follows::
geometry = _(element).getGeometry()
The full syntax without using the shorthand can also be used::
geometry = revitron.Geometry(element)
"""


class Geometry:
"""
A collection of useful methods for handling Revit element geometries.
"""

def __init__(self, element):
"""
Inits a new Geometry instance.
Args:
element (object): A Revit element
"""
import revitron
self._geometry = element.get_Geometry(revitron.DB.Options())


def getFaces(self):
"""
Get a list of all faces of a given element.
Returns:
list: A list of face objects
"""
faces = []
for solid in self.getSolids():
for face in solid.Faces:
faces.append(face)
return faces


def getSolids(self):
"""
Get a list of all solids of a given element.
Returns:
list: A list of solid objects
"""
solids = []
for geo in self._geometry:
for item in geo.GetInstanceGeometry():
try:
if item.Volume:
solids.append(item)
except:
pass
return solids

0 comments on commit 0c8bd58

Please sign in to comment.