diff --git a/docs_src/notebooks/fractopo_network_1.ipynb b/docs_src/notebooks/fractopo_network_1.ipynb index ee75131..4ec4a17 100644 --- a/docs_src/notebooks/fractopo_network_1.ipynb +++ b/docs_src/notebooks/fractopo_network_1.ipynb @@ -44,17 +44,14 @@ "\n", "warnings.filterwarnings(\"ignore\", message=\"The Shapely GEOS\")\n", "warnings.filterwarnings(\"ignore\", message=\"In a future version, \")\n", - "warnings.filterwarnings(\"ignore\", message=\"No data for colormapping provided via\")\n", - "warnings.filterwarnings(\n", - " \"ignore\", message=\"Shapely 2.0 is installed, but because PyGEOS is also installed\"\n", - ")" + "warnings.filterwarnings(\"ignore\", message=\"No data for colormapping provided via\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "`geopandas` is the main module which `fractopo` is based on. It along with `shapely` and `pygeos` implement all spatial operations required for two-dimensional fracture network analysis. `geopandas` further implements all input-output operations like reading and writing spatial datasets (shapefiles, GeoPackages, GeoJSON, etc.)." + "`geopandas` is the main module which `fractopo` is based on. It along with `shapely` implement all spatial operations required for two-dimensional fracture network analysis. `geopandas` further implements all input-output operations like reading and writing spatial datasets (shapefiles, GeoPackages, GeoJSON, etc.)." ] }, { @@ -63,39 +60,36 @@ "metadata": {}, "outputs": [], "source": [ - "import geopandas as gpd" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "`geopandas` uses `matplotlib` for visualizing spatial datasets." + "from pathlib import Path" ] }, { "cell_type": "code", "execution_count": null, + "id": "f94a69f7", "metadata": {}, "outputs": [], "source": [ + "import geopandas as gpd\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "lines_to_next_cell": 2 + }, "source": [ - "Miscellaneous imports." + "`geopandas` uses `matplotlib` for visualizing spatial datasets." ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "cell_type": "markdown", + "metadata": { + "lines_to_next_cell": 2 + }, "source": [ - "from pathlib import Path" + "Miscellaneous imports." ] }, { @@ -166,12 +160,12 @@ "source": [ "## Network\n", "\n", - "So far we have not used any `fractopo` functionality, just `geopandas`. Now we use the `Network` class to create `Network` instances that can be thought of as abstract representations of fracture networks. The fracture network contains traces and a target area boundary delineating the traces. \n", + "So far we have not used any `fractopo` functionality, just `geopandas`. Now we use the `Network` class to create `Network` instances that can be thought of as abstract representations of fracture networks. The fracture network contains traces and a target area boundary delineating the traces.\n", "\n", - "To characterize the topology of a fracture network `fractopo` determines the topological branches and nodes ([Sanderson and Nixon 2015](https://doi.org/10.1016/j.jsg.2015.01.005)). \n", + "To characterize the topology of a fracture network `fractopo` determines the topological branches and nodes ([Sanderson and Nixon 2015](https://doi.org/10.1016/j.jsg.2015.01.005)).\n", "\n", - "- Nodes consist of trace endpoints which can be isolated or snapped to end at another trace. \n", - "- Branches consist of every trace segment between the aforementioned nodes. \n", + "- Nodes consist of trace endpoints which can be isolated or snapped to end at another trace.\n", + "- Branches consist of every trace segment between the aforementioned nodes.\n", "\n", "Automatic determination of branches and nodes is determined with the `determine_branches_nodes` keyword. If given as `False`, they are not determined. You can still use the `Network` object to investigate geometric properties of just the traces.\n", "\n", @@ -184,11 +178,11 @@ "- `circular_target_area`\n", "\n", " - If the target area is a circle `circular_target_area` should be given as `True`. A circular target area is recommended to avoid orientation bias in node counting.\n", - " \n", + "\n", "- `snap_threshold`\n", "\n", " - To determine topological relationships between traces the abutments between traces should be snapped to some tolerance. This tolerance can be given here, in the same unit used for the traces. It represents the smallest distance between nodes for which `fractopo` interprets them as two distinct nodes. This value should be carefully chosen depending on the size of the area of interest. As a reference, when digitizing in QGIS with snapping turned on, the tolerance is probably much lower than `0.001`.\n", - " \n", + "\n", " - The trace validation functionality of `fractopo` can be (and should be) used to check that there are no topological errors within a certain tolerance." ] }, @@ -237,7 +231,7 @@ "outputs": [], "source": [ "# Import identifier strings of topological branches and nodes\n", - "from fractopo.general import CC_branch, CI_branch, II_branch, X_node, Y_node, I_node\n", + "from fractopo.general import CC_branch, CI_branch, I_node, II_branch, X_node, Y_node\n", "\n", "\n", "# Function to determine color for each branch and node type\n", @@ -312,16 +306,16 @@ "source": [ "## Geometric Fracture Network Characterization\n", "\n", - "The most basic geometric properties of traces are their **length** and **orientation**. \n", + "The most basic geometric properties of traces are their **length** and **orientation**.\n", "\n", "**Length** is the overall travel distance along the digitized trace. The length of traces individually is usually not interesting but the value **distribution** of all of the lengths is ([Bonnet et al. 2001](https://doi.org/10.1029/1999RG000074)). `fractopo` uses another Python package, `powerlaw`, for determining power-law, lognormal and exponential distribution fits. The wrapper around `powerlaw` is thin and therefore I urge you to see its [documentation](https://github.com/jeffalstott/powerlaw) and associated [article](https://doi.org/10.1371/journal.pone.0095816) for more info.\n", "\n", "**Orientation** of a trace (or branch, or any line) can be defined in multiple ways that approach the same result when the line is **sublinear**:\n", "\n", - "- Draw a straight line between the start and endpoints of the trace and calculate the orientation of that line. \n", + "- Draw a straight line between the start and endpoints of the trace and calculate the orientation of that line.\n", "\n", " - This is the approach used in `fractopo`. Simple, but when the trace is curvy enough the simplification might be detrimental to analysis.\n", - " \n", + "\n", "- Plot each coordinate point of a trace and fit a linear regression trend line. Calculate the orientation of the trend line.\n", "\n", "- Calculate the orientation of each segment between coordinate points resulting in multiple orientation values for a single trace." @@ -440,17 +434,17 @@ "Branches can be categorized into three main categories:\n", "\n", "- **C–C** is connected at both endpoints\n", - " \n", + "\n", "- **C-I** is connected at one endpoint\n", "\n", "- **I-I** is not connected at either endpoint\n", - " \n", + "\n", "Nodes can be similarly categorized into three categories:\n", "\n", "- **X** represents intersection between two traces\n", - " \n", + "\n", "- **Y** represents abutment of one trace to another\n", - " \n", + "\n", "- **I** represents isolated termination of a trace\n", "\n", "Furthermore **E** node and any **E**-containing branch classification (e.g. **I-E**) are related to the trace area boundary. Branches are always cropped to the boundary and branches that are cut then have a **E** node as end endpoint." diff --git a/docs_src/requirements.txt b/docs_src/requirements.txt deleted file mode 100644 index 02ed3e6..0000000 --- a/docs_src/requirements.txt +++ /dev/null @@ -1,179 +0,0 @@ -alabaster==0.7.13 ; python_version >= "3.8" and python_version < "3.12" -anyio==3.6.2 ; python_version >= "3.8" and python_version < "3.12" -appnope==0.1.3 ; python_version >= "3.8" and python_version < "3.12" and sys_platform == "darwin" or python_version >= "3.8" and python_version < "3.12" and platform_system == "Darwin" -argcomplete==2.0.0 ; python_version >= "3.8" and python_version < "3.12" -argon2-cffi-bindings==21.2.0 ; python_version >= "3.8" and python_version < "3.12" -argon2-cffi==21.3.0 ; python_version >= "3.8" and python_version < "3.12" -arrow==1.2.3 ; python_version >= "3.8" and python_version < "3.12" -asttokens==2.2.1 ; python_version >= "3.8" and python_version < "3.12" -attrs==22.2.0 ; python_version >= "3.8" and python_version < "3.12" -babel==2.11.0 ; python_version >= "3.8" and python_version < "3.12" -backcall==0.2.0 ; python_version >= "3.8" and python_version < "3.12" -beautifulsoup4==4.11.1 ; python_version >= "3.8" and python_version < "3.12" -bleach==5.0.1 ; python_version >= "3.8" and python_version < "3.12" -certifi==2022.12.7 ; python_version >= "3.8" and python_version < "3.12" -cffi==1.15.1 ; python_version >= "3.8" and python_version < "3.12" -cfgv==3.3.1 ; python_version >= "3.8" and python_version < "3.12" -charset-normalizer==3.0.1 ; python_version >= "3.8" and python_version < "3.12" -click-plugins==1.1.1 ; python_version >= "3.8" and python_version < "3.12" -click==8.1.3 ; python_version >= "3.8" and python_version < "3.12" -cligj==0.7.2 ; python_version >= "3.8" and python_version < "3.12" -cloudpickle==2.2.0 ; python_version >= "3.8" and python_version < "3.12" -codespell==2.2.2 ; python_version >= "3.8" and python_version < "3.12" -cogapp==3.3.0 ; python_version >= "3.8" and python_version < "3.12" -colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.12" -colorlog==6.7.0 ; python_version >= "3.8" and python_version < "3.12" -comm==0.1.2 ; python_version >= "3.8" and python_version < "3.12" -commonmark==0.9.1 ; python_version >= "3.8" and python_version < "3.12" -contourpy==1.0.7 ; python_version >= "3.8" and python_version < "3.12" -copier==7.0.1 ; python_version >= "3.8" and python_version < "3.12" -coverage==6.5.0 ; python_version >= "3.8" and python_version < "3.12" -cycler==0.11.0 ; python_version >= "3.8" and python_version < "3.12" -debugpy==1.6.5 ; python_version >= "3.8" and python_version < "3.12" -decorator==5.1.1 ; python_version >= "3.8" and python_version < "3.12" -defusedxml==0.7.1 ; python_version >= "3.8" and python_version < "3.12" -distlib==0.3.6 ; python_version >= "3.8" and python_version < "3.12" -docutils==0.17.1 ; python_version >= "3.8" and python_version < "3.12" -doit==0.36.0 ; python_version >= "3.8" and python_version < "3.12" -dunamai==1.15.0 ; python_version >= "3.8" and python_version < "3.12" -entrypoints==0.4 ; python_version >= "3.8" and python_version < "3.12" -exceptiongroup==1.1.0 ; python_version >= "3.8" and python_version < "3.11" -executing==1.2.0 ; python_version >= "3.8" and python_version < "3.12" -fastjsonschema==2.16.2 ; python_version >= "3.8" and python_version < "3.12" -filelock==3.9.0 ; python_version >= "3.8" and python_version < "3.12" -fiona==1.8.22 ; python_version >= "3.8" and python_version < "3.12" -fonttools==4.38.0 ; python_version >= "3.8" and python_version < "3.12" -fqdn==1.5.1 ; python_version >= "3.8" and python_version < "3.12" -geopandas==0.12.2 ; python_version >= "3.8" and python_version < "3.12" -hypothesis==6.62.1 ; python_version >= "3.8" and python_version < "3.12" -identify==2.5.13 ; python_version >= "3.8" and python_version < "3.12" -idna==3.4 ; python_version >= "3.8" and python_version < "3.12" -imagesize==1.4.1 ; python_version >= "3.8" and python_version < "3.12" -importlib-metadata==6.0.0 ; python_version >= "3.8" and python_version < "3.12" -importlib-resources==5.10.2 ; python_version >= "3.8" and python_version < "3.10" -iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "3.12" -ipykernel==6.20.2 ; python_version >= "3.8" and python_version < "3.12" -ipython-genutils==0.2.0 ; python_version >= "3.8" and python_version < "3.12" -ipython==8.8.0 ; python_version >= "3.8" and python_version < "3.12" -isoduration==20.11.0 ; python_version >= "3.8" and python_version < "3.12" -iteration-utilities==0.11.0 ; python_version >= "3.8" and python_version < "3.12" -jedi==0.18.2 ; python_version >= "3.8" and python_version < "3.12" -jinja2-ansible-filters==1.3.2 ; python_version >= "3.8" and python_version < "3.12" -jinja2==3.1.2 ; python_version >= "3.8" and python_version < "3.12" -joblib==1.2.0 ; python_version >= "3.8" and python_version < "3.12" -json5==0.9.11 ; python_version >= "3.8" and python_version < "3.12" -jsonpointer==2.3 ; python_version >= "3.8" and python_version < "3.12" -jsonschema==4.17.3 ; python_version >= "3.8" and python_version < "3.12" -jsonschema[format-nongpl]==4.17.3 ; python_version >= "3.8" and python_version < "3.12" -jupyter-client==7.4.9 ; python_version >= "3.8" and python_version < "3.12" -jupyter-core==5.1.3 ; python_version >= "3.8" and python_version < "3.12" -jupyter-events==0.6.3 ; python_version >= "3.8" and python_version < "3.12" -jupyter-server-terminals==0.4.4 ; python_version >= "3.8" and python_version < "3.12" -jupyter-server==2.1.0 ; python_version >= "3.8" and python_version < "3.12" -jupyterlab-pygments==0.2.2 ; python_version >= "3.8" and python_version < "3.12" -jupyterlab-server==2.19.0 ; python_version >= "3.8" and python_version < "3.12" -jupyterlab==3.5.2 ; python_version >= "3.8" and python_version < "3.12" -kiwisolver==1.4.4 ; python_version >= "3.8" and python_version < "3.12" -livereload==2.6.3 ; python_version >= "3.8" and python_version < "3.12" -markupsafe==2.1.2 ; python_version >= "3.8" and python_version < "3.12" -matplotlib-inline==0.1.6 ; python_version >= "3.8" and python_version < "3.12" -matplotlib==3.7.1 ; python_version >= "3.8" and python_version < "3.12" -mistune==2.0.4 ; python_version >= "3.8" and python_version < "3.12" -mpmath==1.2.1 ; python_version >= "3.8" and python_version < "3.12" -munch==2.5.0 ; python_version >= "3.8" and python_version < "3.12" -nbclassic==0.4.8 ; python_version >= "3.8" and python_version < "3.12" -nbclient==0.7.2 ; python_version >= "3.8" and python_version < "3.12" -nbconvert==7.2.8 ; python_version >= "3.8" and python_version < "3.12" -nbformat==5.7.3 ; python_version >= "3.8" and python_version < "3.12" -nbsphinx==0.8.11 ; python_version >= "3.8" and python_version < "3.12" -nbstripout==0.6.1 ; python_version >= "3.8" and python_version < "3.12" -nest-asyncio==1.5.6 ; python_version >= "3.8" and python_version < "3.12" -nodeenv==1.7.0 ; python_version >= "3.8" and python_version < "3.12" -notebook-shim==0.2.2 ; python_version >= "3.8" and python_version < "3.12" -notebook==6.5.2 ; python_version >= "3.8" and python_version < "3.12" -nox==2022.11.21 ; python_version >= "3.8" and python_version < "3.12" -numpy==1.24.1 ; python_version < "3.12" and python_version >= "3.8" -packaging==23.0 ; python_version >= "3.8" and python_version < "3.12" -pandas==1.5.2 ; python_version >= "3.8" and python_version < "3.12" -pandocfilters==1.5.0 ; python_version >= "3.8" and python_version < "3.12" -parso==0.8.3 ; python_version >= "3.8" and python_version < "3.12" -pathspec==0.10.3 ; python_version >= "3.8" and python_version < "3.12" -pexpect==4.8.0 ; python_version >= "3.8" and python_version < "3.12" and sys_platform != "win32" -pickleshare==0.7.5 ; python_version >= "3.8" and python_version < "3.12" -pillow==9.4.0 ; python_version >= "3.8" and python_version < "3.12" -pkgutil-resolve-name==1.3.10 ; python_version >= "3.8" and python_version < "3.9" -platformdirs==2.6.2 ; python_version >= "3.8" and python_version < "3.12" -pluggy==1.0.0 ; python_version >= "3.8" and python_version < "3.12" -plumbum==1.8.1 ; python_version >= "3.8" and python_version < "3.12" -powerlaw==1.5 ; python_version >= "3.8" and python_version < "3.12" -pre-commit==2.21.0 ; python_version >= "3.8" and python_version < "3.12" -prometheus-client==0.15.0 ; python_version >= "3.8" and python_version < "3.12" -prompt-toolkit==3.0.36 ; python_version >= "3.8" and python_version < "3.12" -psutil==5.9.4 ; python_version >= "3.8" and python_version < "3.12" -ptyprocess==0.7.0 ; python_version >= "3.8" and python_version < "3.12" and sys_platform != "win32" or python_version >= "3.8" and python_version < "3.12" and os_name != "nt" -pure-eval==0.2.2 ; python_version >= "3.8" and python_version < "3.12" -pycparser==2.21 ; python_version >= "3.8" and python_version < "3.12" -pydantic==1.10.4 ; python_version >= "3.8" and python_version < "3.12" -pygeos==0.14 ; python_version >= "3.8" and python_version < "3.12" -pygments==2.14.0 ; python_version >= "3.8" and python_version < "3.12" -pyinstrument==4.4.0 ; python_version >= "3.8" and python_version < "3.12" -pyparsing==3.0.9 ; python_version >= "3.8" and python_version < "3.12" -pyproj==3.4.1 ; python_version >= "3.8" and python_version < "3.12" -pyrsistent==0.19.3 ; python_version >= "3.8" and python_version < "3.12" -pytest-datadir==1.4.1 ; python_version >= "3.8" and python_version < "3.12" -pytest-regressions==2.4.2 ; python_version >= "3.8" and python_version < "3.12" -pytest==7.2.1 ; python_version >= "3.8" and python_version < "3.12" -python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "3.12" -python-json-logger==2.0.4 ; python_version >= "3.8" and python_version < "3.12" -python-ternary==1.0.8 ; python_version >= "3.8" and python_version < "3.12" -pytz==2022.7.1 ; python_version >= "3.8" and python_version < "3.12" -pywin32==305 ; platform_system == "Windows" and platform_python_implementation != "PyPy" and python_version >= "3.8" and python_version < "3.12" or sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.8" and python_version < "3.12" -pywinpty==2.0.10 ; python_version >= "3.8" and python_version < "3.12" and os_name == "nt" -pyyaml-include==1.3 ; python_version >= "3.8" and python_version < "3.12" -pyyaml==6.0 ; python_version >= "3.8" and python_version < "3.12" -pyzmq==25.0.0 ; python_version >= "3.8" and python_version < "3.12" -questionary==1.10.0 ; python_version >= "3.8" and python_version < "3.12" -requests==2.28.2 ; python_version >= "3.8" and python_version < "3.12" -rfc3339-validator==0.1.4 ; python_version >= "3.8" and python_version < "3.12" -rfc3986-validator==0.1.1 ; python_version >= "3.8" and python_version < "3.12" -rich==13.1.0 ; python_version >= "3.8" and python_version < "3.12" -scikit-learn==1.2.0 ; python_version >= "3.8" and python_version < "3.12" -scipy==1.10.0 ; python_version >= "3.8" and python_version < "3.12" -seaborn==0.12.2 ; python_version >= "3.8" and python_version < "3.12" -send2trash==1.8.0 ; python_version >= "3.8" and python_version < "3.12" -setuptools==66.0.0 ; python_version >= "3.8" and python_version < "3.12" -shapely==1.8.5.post1 ; python_version >= "3.8" and python_version < "3.12" -six==1.16.0 ; python_version >= "3.8" and python_version < "3.12" -sniffio==1.3.0 ; python_version >= "3.8" and python_version < "3.12" -snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "3.12" -sortedcontainers==2.4.0 ; python_version >= "3.8" and python_version < "3.12" -soupsieve==2.3.2.post1 ; python_version >= "3.8" and python_version < "3.12" -sphinx-autobuild==2021.3.14 ; python_version >= "3.8" and python_version < "3.12" -sphinx-autodoc-typehints==1.23.4 ; python_version >= "3.8" and python_version < "3.12" -sphinx-gallery==0.11.1 ; python_version >= "3.8" and python_version < "3.12" -sphinx-rtd-theme==1.1.1 ; python_version >= "3.8" and python_version < "3.12" -sphinx==5.3.0 ; python_version >= "3.8" and python_version < "3.12" -sphinxcontrib-applehelp==1.0.3 ; python_version >= "3.8" and python_version < "3.12" -sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "3.12" -sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.8" and python_version < "3.12" -sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.8" and python_version < "3.12" -sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.8" and python_version < "3.12" -sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.8" and python_version < "3.12" -stack-data==0.6.2 ; python_version >= "3.8" and python_version < "3.12" -terminado==0.17.1 ; python_version >= "3.8" and python_version < "3.12" -threadpoolctl==3.1.0 ; python_version >= "3.8" and python_version < "3.12" -tinycss2==1.2.1 ; python_version >= "3.8" and python_version < "3.12" -toml==0.10.2 ; python_version >= "3.8" and python_version < "3.12" -tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.12" -tornado==6.2 ; python_version >= "3.8" and python_version < "3.12" -traitlets==5.8.1 ; python_version >= "3.8" and python_version < "3.12" -typer==0.7.0 ; python_version >= "3.8" and python_version < "3.12" -typing-extensions==4.4.0 ; python_version >= "3.8" and python_version < "3.12" -uri-template==1.2.0 ; python_version >= "3.8" and python_version < "3.12" -urllib3==1.26.14 ; python_version >= "3.8" and python_version < "3.12" -virtualenv==20.17.1 ; python_version >= "3.8" and python_version < "3.12" -wcwidth==0.2.6 ; python_version >= "3.8" and python_version < "3.12" -webcolors==1.12 ; python_version >= "3.8" and python_version < "3.12" -webencodings==0.5.1 ; python_version >= "3.8" and python_version < "3.12" -websocket-client==1.4.2 ; python_version >= "3.8" and python_version < "3.12" -zipp==3.11.0 ; python_version >= "3.8" and python_version < "3.12" diff --git a/fractopo/tval/trace_validation.py b/fractopo/tval/trace_validation.py index aad6ed2..3792222 100644 --- a/fractopo/tval/trace_validation.py +++ b/fractopo/tval/trace_validation.py @@ -138,7 +138,7 @@ def intersect_nodes(self) -> List[Tuple[Point, ...]]: @property def spatial_index(self) -> Optional[Any]: """ - Get geopandas/pygeos spatial_index of traces. + Get geopandas spatial index of traces. """ if self._spatial_index is None: spatial_index: SpatialIndex = self.traces.sindex