Skip to content

Commit

Permalink
Merge pull request #142 from BlockResearchGroup/workflow
Browse files Browse the repository at this point in the history
double quote
  • Loading branch information
Licini authored Nov 17, 2022
2 parents 40d9e16 + 8f855be commit 04f7ea9
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 165 deletions.
12 changes: 6 additions & 6 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
search = version="{current_version}"
replace = version="{new_version}"

[bumpversion:file:docs/conf.py]
search = release = '{current_version}'
replace = release = '{new_version}'
search = release = "{current_version}"
replace = release = "{new_version}"

[bumpversion:file:src/compas_ags/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bumpversion:file:CHANGELOG.md]
search = Unreleased
Expand Down
66 changes: 34 additions & 32 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@

# -- General configuration ------------------------------------------------

project = 'compas-ags'
copyright = '2017, Block Research Group - ETH Zurich'
author = 'Tom Van Mele'
release = '1.1.1'
project = "compas-ags"
copyright = "2017, Block Research Group - ETH Zurich"
author = "Tom Van Mele"
release = "1.1.1"

version = '.'.join(release.split('.')[0:2])
version = ".".join(release.split(".")[0:2])

master_doc = 'index'
source_suffix = ['.rst', ]
templates_path = ['_templates']
master_doc = "index"
source_suffix = [
".rst",
]
templates_path = ["_templates"]
exclude_patterns = []

pygments_style = 'sphinx'
pygments_style = "sphinx"
show_authors = True
add_module_names = True
language = None
Expand All @@ -31,26 +33,26 @@
# -- Extension configuration ------------------------------------------------

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'matplotlib.sphinxext.plot_directive',
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"matplotlib.sphinxext.plot_directive",
]

# autodoc options

autodoc_mock_imports = ["Rhino", "System", "scriptcontext", "rhinoscriptsyntax", "clr", "bpy"]

autodoc_default_options = {
'undoc-members': True,
'show-inheritance': True,
"undoc-members": True,
"show-inheritance": True,
}

autodoc_member_order = 'groupwise'
autodoc_member_order = "groupwise"

autoclass_content = "class"

Expand All @@ -76,21 +78,21 @@

# first, we define new methods for any new sections and add them to the class
def parse_keys_section(self, section):
return self._format_fields('Keys', self._consume_fields())
return self._format_fields("Keys", self._consume_fields())


NumpyDocstring._parse_keys_section = parse_keys_section


def parse_attributes_section(self, section):
return self._format_fields('Attributes', self._consume_fields())
return self._format_fields("Attributes", self._consume_fields())


NumpyDocstring._parse_attributes_section = parse_attributes_section


def parse_class_attributes_section(self, section):
return self._format_fields('Class Attributes', self._consume_fields())
return self._format_fields("Class Attributes", self._consume_fields())


NumpyDocstring._parse_class_attributes_section = parse_class_attributes_section
Expand All @@ -99,8 +101,8 @@ def parse_class_attributes_section(self, section):
# we now patch the parse method to guarantee that the the above methods are
# assigned to the _section dict
def patched_parse(self):
self._sections['keys'] = self._parse_keys_section
self._sections['class attributes'] = self._parse_class_attributes_section
self._sections["keys"] = self._parse_keys_section
self._sections["class attributes"] = self._parse_class_attributes_section
self._unpatched_parse()


Expand All @@ -124,14 +126,14 @@ def patched_parse(self):
# intersphinx options

intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'compas': ('https://compas-dev.github.io/compas', 'https://compas-dev.github.io/compas/objects.inv'),
"python": ("https://docs.python.org/", None),
"compas": ("https://compas-dev.github.io/compas", "https://compas-dev.github.io/compas/objects.inv"),
}


# -- Options for HTML output ----------------------------------------------

html_theme = 'compaspkg'
html_theme = "compaspkg"
html_theme_path = sphinx_compas_theme.get_html_theme_path()
html_theme_options = {
"package_name": "compas_ags",
Expand All @@ -141,14 +143,14 @@ def patched_parse(self):
"package_description": "COMPAS package for Algebraic Graph Statics",
"package_repo": "https://github.com/BlockResearchGroup/compas_ags",
"package_docs": "https://blockresearchgroup.github.io/compas_ags/",
"package_old_versions_txt": "https://blockresearchgroup.github.io/compas_ags/doc_versions.txt"
"package_old_versions_txt": "https://blockresearchgroup.github.io/compas_ags/doc_versions.txt",
}
html_context = {}
html_static_path = []
html_extra_path = ['.nojekyll']
html_last_updated_fmt = ''
html_extra_path = [".nojekyll"]
html_last_updated_fmt = ""
html_copy_source = False
html_show_sourcelink = False
html_add_permalinks = ''
html_add_permalinks = ""
html_experimental_html5_writer = True
html_compact_lists = True
15 changes: 7 additions & 8 deletions docs/examples/00_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# make form and force diagrams
# ------------------------------------------------------------------------------

graph = FormGraph.from_obj(compas_ags.get('paper/gs_form_force.obj'))
graph = FormGraph.from_obj(compas_ags.get("paper/gs_form_force.obj"))

form = FormDiagram.from_graph(graph)
force = ForceDiagram.from_formdiagram(form)
Expand All @@ -35,17 +35,16 @@

viewer = Viewer(form, force, delay_setup=False, figsize=(12, 7.5))

left = list(form.vertices_where({'x': 0.0, 'y': 0.0}))[0]
right = list(form.vertices_where({'x': 6.0, 'y': 0.0}))[0]
left = list(form.vertices_where({"x": 0.0, "y": 0.0}))[0]
right = list(form.vertices_where({"x": 6.0, "y": 0.0}))[0]

viewer.draw_form(
vertexsize=0.15,
vertexcolor={key: '#000000' for key in (left, right)},
vertexcolor={key: "#000000" for key in (left, right)},
vertexlabel={key: key for key in form.vertices()},
edgelabel={uv: index for index, uv in enumerate(form.edges())})
edgelabel={uv: index for index, uv in enumerate(form.edges())},
)

viewer.draw_force(
vertexsize=0.15,
vertexlabel={key: key for key in force.vertices()})
viewer.draw_force(vertexsize=0.15, vertexlabel={key: key for key in force.vertices()})

viewer.show()
76 changes: 41 additions & 35 deletions docs/examples/01_rtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# including loads and reaction forces.
# ==============================================================================

graph = FormGraph.from_obj(compas_ags.get('paper/gs_form_force.obj'))
graph = FormGraph.from_obj(compas_ags.get("paper/gs_form_force.obj"))

form = FormDiagram.from_graph(graph)
force = ForceDiagram.from_formdiagram(form)
Expand All @@ -21,11 +21,11 @@
# Fix the left and right supports.
# ==============================================================================

left = next(form.vertices_where({'x': 0.0, 'y': 0.0}))
right = next(form.vertices_where({'x': 6.0, 'y': 0.0}))
left = next(form.vertices_where({"x": 0.0, "y": 0.0}))
right = next(form.vertices_where({"x": 6.0, "y": 0.0}))
fixed = [left, right]

form.vertices_attribute('is_fixed', True, keys=fixed)
form.vertices_attribute("is_fixed", True, keys=fixed)

# ==============================================================================
# Set the magnitude of the load.
Expand Down Expand Up @@ -53,29 +53,33 @@

form_lines = []
for u, v in form.edges():
form_lines.append({
'start': form.vertex_coordinates(u, 'xy'),
'end': form.vertex_coordinates(v, 'xy'),
'width': 1.0,
'color': '#cccccc',
'style': '--'
})
form_lines.append(
{
"start": form.vertex_coordinates(u, "xy"),
"end": form.vertex_coordinates(v, "xy"),
"width": 1.0,
"color": "#cccccc",
"style": "--",
}
)

force_lines = []
for u, v in force.edges():
force_lines.append({
'start': force.vertex_coordinates(u, 'xy'),
'end': force.vertex_coordinates(v, 'xy'),
'width': 1.0,
'color': '#cccccc',
'style': '--'
})
force_lines.append(
{
"start": force.vertex_coordinates(u, "xy"),
"end": force.vertex_coordinates(v, "xy"),
"width": 1.0,
"color": "#cccccc",
"style": "--",
}
)

# ==============================================================================
# Change the position of the "free" node of the force diagram
# ==============================================================================

force.vertex[4]['x'] -= 8.0
force.vertex[4]["x"] -= 8.0

# ==============================================================================
# Update the form diagram accordingly.
Expand All @@ -87,29 +91,31 @@
# Indicate the movement of the free node in the force diagram with an arrow.
# ==============================================================================

force_lines.append({
'start': force_key_xyz[4],
'end': force.vertex_coordinates(4),
'color': '#ff0000',
'width': 10.0,
'style': '-',
})
force_lines.append(
{
"start": force_key_xyz[4],
"end": force.vertex_coordinates(4),
"color": "#ff0000",
"width": 10.0,
"style": "-",
}
)

# ==============================================================================
# Visualize the result.
# ==============================================================================

viewer = Viewer(form, force, delay_setup=False, figsize=(12, 7.5))

viewer.draw_form(lines=form_lines,
forces_on=False,
vertexlabel={key: key for key in form.vertices()},
vertexsize=0.2,
vertexcolor={key: '#000000' for key in fixed},
edgelabel={key: index for index, key in enumerate(form.edges())})
viewer.draw_form(
lines=form_lines,
forces_on=False,
vertexlabel={key: key for key in form.vertices()},
vertexsize=0.2,
vertexcolor={key: "#000000" for key in fixed},
edgelabel={key: index for index, key in enumerate(form.edges())},
)

viewer.draw_force(lines=force_lines,
vertexlabel={key: key for key in force.vertices()},
vertexsize=0.2)
viewer.draw_force(lines=force_lines, vertexlabel={key: key for key in force.vertices()}, vertexsize=0.2)

viewer.show()
Loading

0 comments on commit 04f7ea9

Please sign in to comment.