Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
june backup and updates
  • Loading branch information
Dan-Patterson authored Jun 9, 2024
1 parent 93aa0de commit f005e7e
Show file tree
Hide file tree
Showing 6 changed files with 587 additions and 352 deletions.
48 changes: 5 additions & 43 deletions arcpro_npg/npg/npg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- Dan_Patterson@carleton.ca
- https://github.com/Dan-Patterson
Modified : 2023-11-05
Modified : 2024-05-04
Creation date during 2019 as part of ``arraytools``.
Purpose
Expand All @@ -30,7 +30,7 @@
See Also
--------
Many links and references in ``_npgeom_notes_.py``.
Many links and references in ``..docs/_npgeom_notes_.txt``.
.. note::
Expand Down Expand Up @@ -86,6 +86,7 @@
# pyflakes: disable=E0401,F403,F401
# pylint: disable=unused-import
# pylint: disable=E0401

# ---- sys, np imports
import sys
import numpy as np
Expand All @@ -105,55 +106,16 @@
from . npGeo import * # noqa
from . npg_geom_hlp import * # noqa
from . npg_geom_ops import * # noqa
from . npg_io import * # noqa
from . npg_bool_hlp import * # noqa
from . npg_bool_ops import * # noqa
from . npg_clip_split import clip_poly, split_poly # noqa
from . npg_io import * # noqa

"""
from npGeo import (
Geo,
roll_coords, array_IFT, arrays_to_Geo,
Geo_to_arrays, Geo_to_lists, _fill_float_array,
is_Geo, reindex_shapes, check_geometry,
dirr
)
"""
# import npg_geom_hlp
# import npg_geom_ops
# import npgDocs
"""
from . import (npgDocs, npGeo, npg_geom_hlp, npg_pip, npg_geom_ops, npg_boolean,
npg_min_circ, npg_overlay, npg_analysis, npg_setops, npg_io,
npg_prn, npg_table, npg_create, npg_utils) # pyflakes.ignore
import npg_boolean
import npg_min_circ
import npg_overlay
import npg_analysis
import npg_setops
import npg_io
import npg_prn
import npg_table
import npg_create
import npg_utils
from . npgDocs import (
npGeo_doc, Geo_hlp, array_IFT_doc, dirr_doc, shapes_doc, parts_doc,
outer_rings_doc, inner_rings_doc, get_shapes_doc, sort_by_extent_doc,
radial_sort_doc
) # pyflakes.ignore
"""

# from . npGeo import *
# from . npg_geom_hlp import *
# from . npg_pip import *
# from . npg_geom_ops import *
# from . npg_boolean import *
# from . npg_min_circ import *
# from . npg_overlay import *
# from . npg_analysis import *
# from . npg_setops import *
# from . npg_io import *
# from . npg_prn import *
# from . npg_table import *
# from . npg_create import *
Expand Down
6 changes: 4 additions & 2 deletions arcpro_npg/npg/npg/npGeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
to geometry have been assigned and methods developed to return geometry
properties.
Modified = "2024-05-04"
----
"""
Expand Down Expand Up @@ -602,13 +604,13 @@ def centers(self, by_shape=True):
shps = self.shapes
if self.K == 2:
return np.stack([np.mean(s[:-1], axis=0) for s in shps])
return np.stack([np.mean(s, axis=0) for s in shps])
return np.asarray([np.mean(s, axis=0) for s in shps])
# -- part centers
o_rings = self.outer_rings(False)
# Remove duplicate start-end for polygons. Use all points otherwise.
if self.K == 2:
return np.stack([np.mean(r[:-1], axis=0) for r in o_rings])
return np.stack([np.mean(r, axis=0) for r in o_rings])
return np.asarray([np.mean(r, axis=0) for r in o_rings])

def centroids(self):
"""Return the centroid of the polygons using `_area_centroid_`."""
Expand Down
6 changes: 3 additions & 3 deletions arcpro_npg/npg/npg/npgDocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
`<https://github.com/Dan-Patterson>`_.
Modified :
2023-02-17
2024-05-04
Purpose
-------
Expand Down Expand Up @@ -54,7 +54,7 @@
'sort_by_extent_doc', 'array_IFT_doc', 'dirr_doc'
]

Modified = "2023-10-09"

author_date = r"""
Author :
Expand Down Expand Up @@ -82,7 +82,7 @@ def _update_docstring(obj, doc):
# ----------------------------------------------------------------------------
# ---- (1) npGeo
#
npGeo_doc = author_date + Modified + r"""
npGeo_doc = author_date + r"""
Purpose
-------
Expand Down
Loading

0 comments on commit f005e7e

Please sign in to comment.