Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203
extend-ignore = E203
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/questions-.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
skip_existing: true
verbose: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
password: ${{ secrets.PYPI_PASSWORD }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ docs/source/sg_execution_times.rst
conda/index.html
conda/channeldata.json
conda/noarch
conda/win-64
conda/win-64
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black"]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ WORKDIR ${HOME}/notebooks
CMD ["jupyter", "lab", "--ip='0.0.0.0'", "--NotebookApp.token=''", "--no-browser" ]

EXPOSE 8050
EXPOSE 8080:8090
EXPOSE 8080:8090
11 changes: 6 additions & 5 deletions LoopStructural/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
from logging.config import dictConfig

__all__ = ["GeologicalModel"]
import tempfile
from pathlib import Path
import tempfile

from .version import __version__

experimental = False
Expand All @@ -18,11 +19,11 @@
ch.setFormatter(formatter)
ch.setLevel(logging.WARNING)
loggers = {}
from .modelling.core.geological_model import GeologicalModel
from .interpolators._api import LoopInterpolator
from .interpolators import InterpolatorBuilder
from .datatypes import BoundingBox
from .utils import log_to_console, log_to_file, getLogger, rng, get_levels
from .interpolators import InterpolatorBuilder
from .interpolators._api import LoopInterpolator
from .modelling.core.geological_model import GeologicalModel
from .utils import get_levels, getLogger, log_to_console, log_to_file, rng

logger = getLogger(__name__)
logger.info("Imported LoopStructural")
Expand Down
34 changes: 18 additions & 16 deletions LoopStructural/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
Various datasets used for documentation and tutorials.
"""

from ._base import load_claudius
from ._base import load_grose2017
from ._base import load_grose2018
from ._base import load_grose2019
from ._base import load_laurent2016
from ._base import load_noddy_single_fold
from ._base import load_intrusion
from ._base import normal_vector_headers
from ._base import strike_dip_headers
from ._base import value_headers
from ._base import load_unconformity
from ._base import load_duplex
from ._base import load_tabular_intrusion
from ._base import load_geological_map_data
from ._base import load_fault_trace
from ._base import load_horizontal
from ._base import (
load_claudius,
load_duplex,
load_fault_trace,
load_geological_map_data,
load_grose2017,
load_grose2018,
load_grose2019,
load_horizontal,
load_intrusion,
load_laurent2016,
load_noddy_single_fold,
load_tabular_intrusion,
load_unconformity,
normal_vector_headers,
strike_dip_headers,
value_headers,
)
1 change: 1 addition & 0 deletions LoopStructural/datasets/_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from os.path import dirname, join
from pathlib import Path
from typing import Tuple

import numpy as np
import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion LoopStructural/datasets/data/fault_trace/fault_trace.cpg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
UTF-8
UTF-8
2 changes: 1 addition & 1 deletion LoopStructural/datasets/data/fault_trace/fault_trace.prj
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PROJCS["GDA2020_MGA_Zone_53",GEOGCS["GCS_GDA2020",DATUM["GDA2020",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",135.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
PROJCS["GDA2020_MGA_Zone_53",GEOGCS["GCS_GDA2020",DATUM["GDA2020",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",135.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
2 changes: 1 addition & 1 deletion LoopStructural/datatypes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._surface import Surface
from ._bounding_box import BoundingBox
from ._point import ValuePoints, VectorPoints
from ._structured_grid import StructuredGrid
from ._surface import Surface
12 changes: 7 additions & 5 deletions LoopStructural/datatypes/_bounding_box.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from __future__ import annotations
from typing import Optional, Union, Dict
from LoopStructural.utils.exceptions import LoopValueError
from LoopStructural.utils import rng
from LoopStructural.datatypes._structured_grid import StructuredGrid
import numpy as np

import copy
from typing import Dict, Optional, Union

import numpy as np

from LoopStructural.datatypes._structured_grid import StructuredGrid
from LoopStructural.utils import rng
from LoopStructural.utils.exceptions import LoopValueError
from LoopStructural.utils.logging import getLogger

logger = getLogger(__name__)
Expand Down
5 changes: 3 additions & 2 deletions LoopStructural/datatypes/_point.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from dataclasses import dataclass, field
import io
from typing import Optional, Union

import numpy as np

from typing import Optional, Union
import io
from LoopStructural.utils import getLogger

logger = getLogger(__name__)
Expand Down
4 changes: 3 additions & 1 deletion LoopStructural/datatypes/_structured_grid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from dataclasses import dataclass, field
from typing import Dict

import numpy as np
from dataclasses import dataclass, field

from LoopStructural.utils import getLogger

logger = getLogger(__name__)
Expand Down
4 changes: 3 additions & 1 deletion LoopStructural/datatypes/_surface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from dataclasses import dataclass, field
import io
from typing import Optional, Union

import numpy as np
import io

from LoopStructural.utils import getLogger

logger = getLogger(__name__)
Expand Down
9 changes: 5 additions & 4 deletions LoopStructural/export/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"""

import os
from pyevtk.hl import unstructuredGridToVTK, pointsToVTK
from pyevtk.vtk import VtkTriangle

import numpy as np
from pyevtk.hl import pointsToVTK, unstructuredGridToVTK
from pyevtk.vtk import VtkTriangle
from skimage.measure import marching_cubes

from LoopStructural.utils.helper import create_box
from LoopStructural.export.file_formats import FileFormat
from LoopStructural.datatypes import Surface
from LoopStructural.export.file_formats import FileFormat
from LoopStructural.utils.helper import create_box

from ..utils import getLogger

Expand Down
1 change: 1 addition & 0 deletions LoopStructural/export/geoh5.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import geoh5py
import geoh5py.workspace
import numpy as np

from LoopStructural.datatypes import ValuePoints, VectorPoints


Expand Down
3 changes: 2 additions & 1 deletion LoopStructural/export/omf_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"You need to install the omf package to use this feature. "
"You can install it with: pip install mira-omf"
)
import numpy as np
import datetime
import os

import numpy as np


def get_project(filename):
if os.path.exists(filename):
Expand Down
34 changes: 16 additions & 18 deletions LoopStructural/interpolators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,29 @@ class InterpolatorType(IntEnum):
"DFI": InterpolatorType.DISCRETE_FOLD,
'surfe': InterpolatorType.SURFE,
}
from ..interpolators._geological_interpolator import GeologicalInterpolator
from ..interpolators._discrete_interpolator import DiscreteInterpolator
from ..interpolators.supports import (
TetMesh,
StructuredGrid,
UnStructuredTetMesh,
P1Unstructured2d,
P2Unstructured2d,
StructuredGrid2D,
P2UnstructuredTetMesh,
SupportType,
from ..interpolators._discrete_fold_interpolator import (
DiscreteFoldInterpolator,
)


from ..interpolators._discrete_interpolator import DiscreteInterpolator
from ..interpolators._finite_difference_interpolator import (
FiniteDifferenceInterpolator,
)
from ..interpolators._geological_interpolator import GeologicalInterpolator
from ..interpolators._p1interpolator import (
P1Interpolator,
P1Interpolator as PiecewiseLinearInterpolator,
)
from ..interpolators._discrete_fold_interpolator import (
DiscreteFoldInterpolator,
)
from ..interpolators._p2interpolator import P2Interpolator
from ..interpolators._p1interpolator import P1Interpolator
from ..interpolators.supports import (
P1Unstructured2d,
P2Unstructured2d,
P2UnstructuredTetMesh,
StructuredGrid,
StructuredGrid2D,
SupportType,
TetMesh,
UnStructuredTetMesh,
)

try:
from ..interpolators._surfe_wrapper import SurfeRBFInterpolator
Expand Down Expand Up @@ -113,7 +111,7 @@ class InterpolatorType(IntEnum):
},
}

from ._interpolator_factory import InterpolatorFactory
from ._interpolator_builder import InterpolatorBuilder
from ._interpolator_factory import InterpolatorFactory

# from ._api import LoopInterpolator
5 changes: 3 additions & 2 deletions LoopStructural/interpolators/_api.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from typing import Optional

import numpy as np

from typing import Optional
from LoopStructural.datatypes import BoundingBox
from LoopStructural.interpolators import (
GeologicalInterpolator,
InterpolatorFactory,
InterpolatorType,
)
from LoopStructural.datatypes import BoundingBox
from LoopStructural.utils import getLogger

logger = getLogger(__name__)
Expand Down
6 changes: 5 additions & 1 deletion LoopStructural/interpolators/_cython/dsi_helper.pyx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import cython
import numpy as np
import numpy.linalg as la

cimport numpy as np

from math import *


@cython.boundscheck(False)
@cython.wraparound(False)
#cython: language_level=3
Expand Down Expand Up @@ -306,4 +310,4 @@ def tetra_neighbours(long long [:,:] elements, long long [:,:] neighbours):
# pairs[face_n][1] = n
#
# face_n+=1
# return pairs
# return pairs
4 changes: 2 additions & 2 deletions LoopStructural/interpolators/_discrete_fold_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Piecewise linear interpolator using folds
"""

from typing import Optional, Callable
from typing import Callable, Optional

import numpy as np

from ..interpolators import PiecewiseLinearInterpolator, InterpolatorType
from ..interpolators import InterpolatorType, PiecewiseLinearInterpolator
from ..modelling.features.fold import FoldEvent
from ..utils import getLogger, rng

Expand Down
5 changes: 2 additions & 3 deletions LoopStructural/interpolators/_discrete_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
"""

from abc import abstractmethod
from typing import Callable, Optional, Union
import logging
from typing import Callable, Optional, Union

import numpy as np
from scipy import sparse # import sparse.coo_matrix, sparse.bmat, sparse.eye
from ..interpolators import InterpolatorType

from ..interpolators import GeologicalInterpolator
from ..interpolators import GeologicalInterpolator, InterpolatorType
from ..utils import getLogger

logger = getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"""

import numpy as np
from scipy.spatial import KDTree

from LoopStructural.utils import getLogger

from ..interpolators import InterpolatorType
from ..utils import get_vectors
from ._discrete_interpolator import DiscreteInterpolator
from ..interpolators import InterpolatorType
from scipy.spatial import KDTree
from LoopStructural.utils import getLogger

logger = getLogger(__name__)

Expand Down
8 changes: 5 additions & 3 deletions LoopStructural/interpolators/_geological_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"""

from abc import ABCMeta, abstractmethod
from LoopStructural.utils.exceptions import LoopTypeError
from ..interpolators import InterpolatorType
from typing import Optional

import numpy as np

from typing import Optional
from LoopStructural.utils.exceptions import LoopTypeError

from ..interpolators import InterpolatorType
from ..utils import getLogger

logger = getLogger(__name__)
Expand Down
Loading
Loading