Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6d67079
style: style fixes by ruff and autoformatting by black
rabii-chaarani Jul 29, 2024
3c2fd44
doc: added example notebook
rabii-chaarani Jul 31, 2024
971ba1a
doc: added docstrings and fixes
rabii-chaarani Jul 31, 2024
a343c73
fix: added correct imports
rabii-chaarani Jul 31, 2024
22c8f2a
fix: use correct function name
rabii-chaarani Jul 31, 2024
d96bbeb
style: style fixes by ruff and autoformatting by black
rabii-chaarani Jul 31, 2024
43c0aaf
test: use correct function name
rabii-chaarani Jul 31, 2024
9605deb
chore: updated gitignore
rabii-chaarani Jul 31, 2024
7f1661d
chore: .pyc files
rabii-chaarani Jul 31, 2024
59628d7
test: added NTGS test data and example of use
rabii-chaarani Aug 19, 2024
7aa21d5
chore: added test structure data
rabii-chaarani Aug 23, 2024
2178652
fix: added structure table handling to dip conversion
rabii-chaarani Aug 23, 2024
0e8dfa7
chore: updated init file
rabii-chaarani Aug 23, 2024
1f1fa45
fix: converts correctly shapefiles
rabii-chaarani Aug 23, 2024
37609ff
fix: reads correctly input files
rabii-chaarani Aug 23, 2024
af0b3bb
ci: integrate only master branch
rabii-chaarani Aug 23, 2024
94482a1
style: style fixes by ruff and autoformatting by black
rabii-chaarani Aug 23, 2024
7c415a4
fix: corrected column names
rabii-chaarani Aug 26, 2024
7d709ca
ci: add mamba solver to requirements
rabii-chaarani Aug 26, 2024
230270e
fix: added import of ntgs m2l config
rabii-chaarani Aug 26, 2024
9bb5a8c
ci: use conda classic solver
rabii-chaarani Aug 26, 2024
7cc3fc6
fix: use correct import name
rabii-chaarani Aug 26, 2024
deca921
style: style fixes by ruff and autoformatting by black
rabii-chaarani Aug 26, 2024
2a74211
fix: corrected imports
rabii-chaarani Aug 26, 2024
8746bdb
fix: corrected file saving method
rabii-chaarani Aug 27, 2024
b8dbc71
style: style fixes by ruff and autoformatting by black
rabii-chaarani Aug 27, 2024
1ed5578
fix: ignore "Unknown" formation names
rabii-chaarani Aug 28, 2024
50f5bf7
fix: Remove 'Pertatataka_Formation' from ignore_codes in NtgsConfig
rabii-chaarani Oct 14, 2024
75ac134
style: style fixes by ruff and autoformatting by black
rabii-chaarani Oct 14, 2024
5724ae5
chore: add new data files of Henbury dataset
rabii-chaarani Nov 6, 2024
2575753
chore: add notebook example 1 for Henbury dataset
rabii-chaarani Nov 6, 2024
be834a5
chore: clean up cells
rabii-chaarani Nov 6, 2024
7da7a5e
style: style fixes by ruff and autoformatting by black
rabii-chaarani Nov 6, 2024
681ff9a
chore: clean output
rabii-chaarani Nov 6, 2024
a005a2a
chore: update cells
rabii-chaarani Nov 6, 2024
1b4d63d
chore: remove unused code cell
rabii-chaarani Nov 6, 2024
8015a55
chore: add Henbury fault data
rabii-chaarani Nov 8, 2024
840f135
chore: added new Henbury dataset
rabii-chaarani Nov 13, 2024
391ff45
feat: add FaultConnector
rabii-chaarani Nov 27, 2024
9ae4686
chore: added docstrings and logging
rabii-chaarani Nov 27, 2024
8f6a900
style: style fixes by ruff and autoformatting by black
rabii-chaarani Nov 27, 2024
050a806
refactor: Refactor code structure for improved readability and mainta…
rabii-chaarani Jun 18, 2025
2294100
style: style fixes by ruff and autoformatting by black
rabii-chaarani Jun 18, 2025
2642d8c
Fix conversion utilities for fold data (#4)
rabii-chaarani Jun 18, 2025
13a806b
fix: remove ignore_codes from geology_config
rabii-chaarani Aug 11, 2025
af4b03c
fix: remove unused columns from fault and structure configurations
rabii-chaarani Aug 11, 2025
785f9e3
fix: update conda solver to libmamba
rabii-chaarani Oct 31, 2025
6f32951
fix: update conda install command
rabii-chaarani Oct 31, 2025
b5823f0
fix: update conda upload steps
rabii-chaarani Oct 31, 2025
8f3804d
fix: update steps for conda package building
rabii-chaarani Oct 31, 2025
f5df027
fix: restore conda upload steps
rabii-chaarani Nov 3, 2025
24c9499
fix: switch libmamba to classic
rabii-chaarani Nov 10, 2025
b4b87a2
fix: update conda configuration
rabii-chaarani Nov 10, 2025
db0cf10
fix: switch conda solver to libmamba
rabii-chaarani Nov 10, 2025
53cf847
fix: change build name
rabii-chaarani Nov 12, 2025
a368f0c
fix: update python version matrix to include 3.13
rabii-chaarani Nov 16, 2025
88741a3
fix: update artifact name to include python version in conda upload
rabii-chaarani Nov 17, 2025
7cdf374
fix: correct syntax error in artifact name for conda upload
rabii-chaarani Nov 17, 2025
eb80a06
fix: update artifact name for conda build
rabii-chaarani Nov 17, 2025
4e98ccd
fix: update numpy version constraint
rabii-chaarani Nov 17, 2025
0bb2c7e
fix: update numpy >=2.1.0
rabii-chaarani Nov 17, 2025
8bfbbe9
fix: numpy version conda config
rabii-chaarani Nov 17, 2025
575b8c6
fix: numpy version in meta.yaml
rabii-chaarani Nov 17, 2025
e0ceca3
fix: conda min python version to 3.10
rabii-chaarani Nov 17, 2025
3ce122d
fix: update numpy version
rabii-chaarani Nov 17, 2025
988983b
fix: improved ci workflow
rabii-chaarani Nov 17, 2025
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
44 changes: 16 additions & 28 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Installing dependencies
shell: bash -l {0}
run: |
conda install -c conda-forge numpy scipy pytest dill beartype pandas geopandas shapely validators sqlite -y
conda install -c conda-forge 'numpy>=2.1.0' scipy pytest dill beartype pandas geopandas shapely validators sqlite -y
- name: Building and install
shell: bash -l {0}
run: |
Expand All @@ -49,7 +49,7 @@ jobs:

release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
if: github.ref == 'refs/heads/master'
steps:
- uses: GoogleCloudPlatform/release-please-action@v4
id: release
Expand All @@ -61,20 +61,14 @@ jobs:
release_created: ${{ steps.release.outputs.release_created }}
# if a release is created then run the deploy scripts for github.io, conda, pypi and docker

conda-deploy:
name: Building conda package for python ${{ matrix.os }})
conda-build:
name: Building conda package for python
needs: "continuous-integration"
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- uses: actions/checkout@v4
- name: update submodules
Expand All @@ -86,16 +80,15 @@ jobs:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -l {0}
run: |
conda install -c conda-forge conda-build pytest numpy scipy pandas geopandas sqlite shapely validators anaconda-client -y
conda build -c anaconda -c conda-forge --output-folder conda conda
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda
conda install anaconda-client -y
conda config --set solver libmamba
conda install -c conda-forge conda-build pytest 'numpy>=2.1.0' scipy pandas geopandas sqlite shapely validators anaconda-client conda-libmamba-solver -y
conda build -c conda-forge --output-folder conda conda

- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: conda-${{ matrix.os }}-${{ matrix.python-version }}
name: conda-build
path: conda

make_sdist:
needs: "continuous-integration"
name: Make SDist
Expand All @@ -114,18 +107,13 @@ jobs:
path: dist/

upload_to_conda:
needs: ["release-please", "conda-deploy"]
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
needs: ["release-please", "conda-build"]
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/download-artifact@v4
with:
name: conda-${{ matrix.os }}-${{ matrix.python-version }}
name: conda
path: conda
- uses: conda-incubator/setup-miniconda@v3
- name: upload all files to conda-forge
Expand All @@ -134,10 +122,10 @@ jobs:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
conda install -c anaconda anaconda-client -y
anaconda upload --label main conda/*/*.tar.bz2
anaconda upload --label main conda/*/*.conda

upload_to_pypi:
needs: ["release-please", "conda-deploy"]
needs: ["release-please", "conda-build"]
runs-on: "ubuntu-latest"

if: ${{ needs.release-please.outputs.release_created }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ LoopDataConverter.egg-info/requires.txt
LoopDataConverter.egg-info/SOURCES.txt
LoopDataConverter.egg-info/PKG-INFO
LoopDataConverter.egg-info/dependency_links.txt
examples/.ipynb_checkpoints/ntgs_example_1-checkpoint.ipynb
5 changes: 5 additions & 0 deletions LoopDataConverter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .converters import LoopConverter
from .input import InputData
from .datatypes import SurveyName, Datatype
from .fields import NtgsConfig
from .geometry_correction import FaultConnector
Binary file modified LoopDataConverter/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
12 changes: 1 addition & 11 deletions LoopDataConverter/converters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
from .base_converter import BaseConverter
from .ntgs_converter import NTGSConverter
from .loop_converter import LoopConverter
from ..datatypes import SurveyName

converter_map = {
SurveyName.NTGS: NTGSConverter,
SurveyName.GA: "",
SurveyName.GSQ: "",
SurveyName.GSWA: "",
SurveyName.GSSA: "",
SurveyName.GSV: "",
SurveyName.MRT: "",
SurveyName.GSNSW: "",
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 0 additions & 44 deletions LoopDataConverter/converters/conversion_manager.py

This file was deleted.

91 changes: 91 additions & 0 deletions LoopDataConverter/converters/loop_converter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
from .ntgs_converter import NTGSConverter
from ..datatypes import SurveyName, Datatype
from ..file_readers import LoopGisReader
from ..input import InputData


class LoopConverter:
"""
LoopConverter class use the LoopGisReader to look up the correct file
reader for the input file type and then converting the data to
Map2Loop format using the adequate converter
"""

def __init__(self, survey_name: SurveyName, data: InputData, layer: str = None):
'''
This function initializes an object with survey name, input data, and optional layer
information, along with converters for different survey names.

Parameters
----------
survey_name : SurveyName
`survey_name` is a parameter that represents the name of a survey. It is expected to be of type
`SurveyName`.
data : InputData
The `data` parameter in the `__init__` method is of type `InputData`. It seems to represent the
data that will be used in the survey.
layer : str
The `layer` parameter is a string that represents a specific layer within a .GPKG file.
It is an optional parameter with a default value of `None`, which means it can be omitted
when creating an instance of the class. If provided, it specifies the layer to

'''
self._fileData = data
self._layer = layer
self._survey_name = survey_name
self._converters = {
SurveyName.NTGS: NTGSConverter,
SurveyName.GA: "",
SurveyName.GSQ: "",
SurveyName.GSWA: "",
SurveyName.GSSA: "",
SurveyName.GSV: "",
SurveyName.GSNSW: "",
SurveyName.MRT: "",
}
self._used_converter = None

def read_file(self):
"""
read the file using the correct file reader
"""
self.file_reader = LoopGisReader(self._fileData)
self.file_reader()
return self.file_reader._data

def get_converter(self):
'''
This function returns a converter based on the survey name.

Returns
-------
The `get_converter` method is returning the converter associated with the survey name stored in
the `_survey_name` attribute.

'''
return self._converters[self._survey_name]

def convert(self):
'''
This function reads data from a file, uses a converter to process the data, and stores the
converted data in the object's data attribute.

'''
data = self.read_file()
self._used_converter = self.get_converter()
self._used_converter = self._used_converter(data)
self._used_converter.convert()
self.data = self._used_converter._data

def save(self, datatype: Datatype, file_path: str, file_extension: str = None):
if file_extension == "geojson":
self.data[datatype].to_file(file_path, driver="GeoJSON")

elif file_extension == "gpkg":
self.data.to_file(file_path, driver="GPKG")

elif file_extension == "shp":
self.data[datatype].to_file(file_path)

else:
raise ValueError(f"Unsupported file format: {file_extension}")
Loading
Loading