Skip to content

Commit

Permalink
fix typos and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
j042 committed Oct 3, 2023
1 parent 2342c1a commit ab5afea
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/load_sample_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ def load_sample_file(filename: str, force_reload: bool = False) -> bool:
f.write(response.content)
return True
else:
print(f"Cant load {url}, status code: {response.status_code}.")
print(f"Can't load {url}, status code: {response.status_code}.")
return False
7 changes: 4 additions & 3 deletions gustaf/create/faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def to_simplex(quad, alternate=False):
vice versa. Will return a tri-mesh, if input is triangular.
Default diagonalization looks like this:
.. code-block::
.. code-block:: text
(3) *---* (2)
| /|
Expand All @@ -66,7 +66,7 @@ def to_simplex(quad, alternate=False):
resembling 'slash'.
.. code-block::
.. code-block:: text
(3) *---* (2)
|\\ |
Expand Down Expand Up @@ -136,7 +136,8 @@ def to_quad(tri):
each triangle face. Warning: mesh quality could be bad!
``(new) Quad Face``
.. code-block::
.. code-block:: text
Ref: (node_ind), face_ind
Expand Down
2 changes: 1 addition & 1 deletion gustaf/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def dashed(self, spacing=None):
``dashed edges``
.. code-block::
.. code-block:: text
o--------o o--------o o--------o
|<------>| |<-->|
Expand Down
4 changes: 2 additions & 2 deletions gustaf/helpers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def depends_on(cls, var_names, make_property=False):
"""

def inner(func):
# followings are done once while modules are loaded
# following are done once while modules are loaded
# just subclass this class to make a special helper
# for each helpee class.
assert isinstance(var_names, list), "var_names should be a list"
Expand Down Expand Up @@ -373,7 +373,7 @@ def compute_or_return_saved(*args, **kwargs):
recompute = kwargs.get("recompute", True)

# computed arrays are called _computed.
# loop over dependees and check if they are modified
# loop over dependencies and check if they are modified
for dependee_str in cls._depends[func.__name__]:
dependee = getattr(self, dependee_str)
# is modified?
Expand Down
3 changes: 2 additions & 1 deletion gustaf/io/meshio.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def export(mesh, fname, submeshes=None, **kwargs):
.. code-block:: python
import gustaf
# define coordinates
v = np.array(
[
Expand Down Expand Up @@ -126,7 +127,7 @@ def export(mesh, fname, submeshes=None, **kwargs):
vertices=v,
faces=tf,
)
gustaf.io.meshio.export(mesh, 'tri-mesh.stl')
gustaf.io.meshio.export(mesh, "tri-mesh.stl")
Parameters
------------
Expand Down
2 changes: 1 addition & 1 deletion gustaf/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _vedo_showable(obj, as_dict=False, **kwargs):
--------
vedo_obj: vedo obj
"""
# incase kwargs are defined, we will make a copy of the object and
# in case kwargs are defined, we will make a copy of the object and
# try to overwrite all the applicable kwargs.
if kwargs:
# keep original ones and assign new show_options temporarily
Expand Down
14 changes: 7 additions & 7 deletions gustaf/utils/connec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def tet_to_tri(volumes):
``Tetrahedron``
.. code-block::
.. code-block:: text
Ref: (node_ind), face_ind
Expand Down Expand Up @@ -71,7 +71,7 @@ def hexa_to_quad(volumes):
``Hexahedron``
.. code-block::
.. code-block:: text
(6) (7)
Expand Down Expand Up @@ -149,7 +149,7 @@ def volumes_to_faces(volumes):
def faces_to_edges(faces):
"""Compute edges based on following edge scheme.
.. code-block::
.. code-block:: text
Ref: (node_ind), edge_ind
Expand Down Expand Up @@ -270,7 +270,7 @@ def make_quad_faces(resolutions):
"""Given number of nodes per each dimension, returns connectivity
information of a structured mesh. Counter clock wise connectivity.
.. code-block::
.. code-block:: text
(3)*------*(2)
| |
Expand Down Expand Up @@ -314,7 +314,7 @@ def make_hexa_volumes(resolutions):
information of structured hexahedron elements. Counter clock wise
connectivity.
.. code-block::
.. code-block:: text
(7)*-------*(6)
/| /|
Expand Down Expand Up @@ -377,7 +377,7 @@ def subdivide_edges(edges):
``Subdivided Edges``
.. code-block::
.. code-block:: text
Edges (Lines)
Expand Down Expand Up @@ -413,7 +413,7 @@ def subdivide_tri(
``Subdivided Faces``
.. code-block::
.. code-block:: text
Triangles
Expand Down
2 changes: 1 addition & 1 deletion gustaf/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def prepended_log(message, log_func):
----------
message: str
log_func: function
one of the followings - {info, debug, warning}
one of the following - {info, debug, warning}
Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions tests/test_vertices_and_element_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_unique_vertices(grid, request):
# copy original
n_original_vertices = len(grid.vertices)
original_vertices = grid.vertices.copy()
# assgin new vertices
# assign new vertices
# ==> stacks (original, random, original, random)
grid.vertices = np.vstack(
(grid.vertices, random_vertices, original_vertices, random_vertices)
Expand All @@ -100,7 +100,7 @@ def test_unique_vertices(grid, request):
assert all(np.tile(np.arange(n_expected_unique), 2) == unique_vs.inverse)

# intersection check - should include itself as well
# also, should be sorted, assuming scipy verion is > 1.6
# also, should be sorted, assuming scipy version is > 1.6
intersection_list = [*unique_vs.intersection]
intersection_ref = [
[i, i + n_expected_unique] for i in range(n_expected_unique)
Expand Down

0 comments on commit ab5afea

Please sign in to comment.