Skip to content
Open
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
10 changes: 7 additions & 3 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }}
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -27,10 +27,14 @@ jobs:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -l {0}
run: |
conda config --env --add channels conda-forge
conda config --env --add channels loop3d
conda config --env --set channel_priority strict
conda install -c conda-forge conda-build scikit-build-core numpy anaconda-client conda-libmamba-solver -y
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{matrix.python-version}}
conda config --set solver libmamba
conda build --output-folder conda conda --python ${{matrix.python-version}}
anaconda upload --label main conda/*/*.tar.bz2

- name: upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/linting_and_testing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
name: Linting and Testing

on:
[push]
push:
branches:
- master
paths:
- '**.py'
- .github/workflows/linting_and_testing.yml

pull_request:
branches:
- master
paths:
- '**.py'
- .github/workflows/linting_and_testing.yml
workflow_dispatch:

jobs:
linting:
Expand All @@ -18,17 +31,23 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: style fixes by ruff and autoformatting by black"



testing:
name: Testing
runs-on: ubuntu-24.04
name: Testing${{ matrix.os }} python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: actions/checkout@v4
- name: Install GDAL
run: |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install -y libgdal-dev gdal-bin
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
conda-remove-defaults: "true"


- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

sdist:
name: Build sdist
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -23,7 +23,7 @@ jobs:

publish:
name: Publish wheels to pypi
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.2.0"
".": "3.2.2"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [3.2.2](https://github.com/Loop3D/map2loop/compare/v3.2.1...v3.2.2) (2025-01-13)


### Bug Fixes

* add featureId when parsing fault_orientations ([#177](https://github.com/Loop3D/map2loop/issues/177)) ([924c2cf](https://github.com/Loop3D/map2loop/commit/924c2cf696688abe3dc1c8579753daeb2f1b45e4))

## [3.2.1](https://github.com/Loop3D/map2loop/compare/v3.2.0...v3.2.1) (2025-01-12)


### Bug Fixes

* include dependencies in site-packages - issue [#169](https://github.com/Loop3D/map2loop/issues/169) ([#170](https://github.com/Loop3D/map2loop/issues/170)) ([b33532b](https://github.com/Loop3D/map2loop/commit/b33532b56473148433fd192e182aadee028dc875))

## [3.2.0](https://github.com/Loop3D/map2loop/compare/v3.1.13...v3.2.0) (2024-12-16)


Expand Down
7 changes: 1 addition & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
include LICENSE
include README.md

include map2loop/_datasets/clut_files/*.csv
include map2loop/_datasets/config_files/*.json
include map2loop/_datasets/geodata_files/hamersley/*

recursive-include tests *.py
include map2loop/_datasets/geodata_files/hamersley/*
80 changes: 24 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,70 @@
![GitHub Release](https://img.shields.io/github/v/release/loop3d/map2loop)
[![DOI](https://img.shields.io/static/v1?label=DOI&message=10.5194/gmd-14-5063-2021&color=blue)](https://doi.org/10.5194/gmd-14-5063-2021)
![License](https://img.shields.io/github/license/loop3d/map2loop)
![PyPI - Downloads](https://img.shields.io/pypi/dm/map2loop?label=pip%20downloads)
![Conda Downloads](https://img.shields.io/conda/dn/loop3d/map2loop?label=Conda%20downloads)
[![Testing](https://github.com/Loop3D/map2loop/actions/workflows/linting_and_testing.yml/badge.svg)](https://github.com/Loop3D/map2loop/actions/workflows/linting_and_testing.yml)
[![Build and Deploy Documentation](https://github.com/Loop3D/map2loop/actions/workflows/documentation.yml/badge.svg)](https://github.com/Loop3D/map2loop/actions/workflows/documentation.yml)

# Map2Loop 3.1

# Map2Loop 3.2

Generate 3D geological model inputs from geological maps — a high-level implementation and extension of the original map2loop code developed by Prof. Mark Jessell at UWA. To see an example interactive model built with map2loop and LoopStructural, follow this link:

<a href="http://tectonique.net/models/brockman_syncline.html">3D Model from the Hamersley region, Western Australia</a>

## Install

You will need some flavour of conda (a Python package manager, [see here](https://docs.anaconda.com/anaconda/install/index.html)), as well as Python ≥ 3.8.
#### Option 1: Install with Anaconda

### Adding ```conda-forge``` to Anaconda channels
map2loop installation may run smoother if ```conda-forge``` is added to the channels.
To check for that, run
This is the simplest and recommended installation process, with:

```bash
conda config --show channels
conda install -c loop3d -c conda-forge map2loop
```
if conda-forge is not in the output, the channel can be added with:

#### Option 2: Install with pip
Installation with pip will require that GDAL is installed on your system prior to map2loop installation.
This is because GDAL cannot be installed <a href='https://hackernoon.com/hn-images/1*m4cnTYJWM7Rmpsju8dSHmQ.jpeg'>via pip</a> (at least not with one line of code), and the GDAL installation process will vary depending on your OS.

For more information on installing gdal, see <a href="https://pypi.org/project/GDAL/">GDAL's Pypi</a> page.

Once GDAL is available on your system, map2loop can be installed with:
```bash
conda config --add channels conda-forge
pip install map2loop
```

### Run

To just use map2loop, issue the following. <sup>*</sup>
#### Option 3: From source

```bash
git clone https://github.com/Loop3D/map2loop.git

cd map2loop

conda install -c loop3d --file dependencies.txt
conda install gdal

conda install -c loop3d -c conda-forge --file dependencies.txt

pip install .
```

<p><sup>*</sup> We're actively working towards a better approach - stay tuned! </p>

### Documentation

If you can call it that, is available <a href="https://loop3d.org/map2loop/">here</a>

### Development

If you want to tinker yourself/contribute, clone the source code with

#### Option 4: From source & developer mode:
```bash
git clone https://github.com/Loop3D/map2loop.git
```

Or get the source + example notebooks with
cd map2loop

```bash
git clone https://github.com/Loop3D/map2loop.git
git clone https://github.com/Loop3D/map2loop-3-notebooks
```
conda install gdal

Navigate into map2loop, and issue the following to install map2loop and its dependencies. _Note_: The 'develop' flag makes your source changes take effect on saving, so you only need to run this once
conda install -c loop3d -c conda-forge --file dependencies.txt

```bash
conda install -c loop3d --file dependencies.txt
pip install -e .
```

## Building with Docker

Fair warning, we recommend conda to almost everyone. With great software development power comes great environment setup inconvenience. You'll need to download and install the [docker containerisation software](https://docs.docker.com/get-docker/), and the docker and docker-compose CLI.

### Development

1. Clone this repo and navigate inside as per above
2. Run the following and click on the Jupyter server forwarded link to access and edit the notebooks

```bash
docker-compose up --build
```

3. To hop into a bash shell in a running container, open a terminal and issue

```bash
docker ps
```
### Documentation

Find the container name or ID and then run
Map2loop's documentation is available <a href="https://loop3d.org/map2loop/">here</a>

```bash
docker exec -it <container_NAMEorID> bash
# Probably -> docker exec -it map2loop_dev_1 bash
```

## Usage

Expand All @@ -118,8 +88,6 @@ bbox_3d = {
}
```

![sa example](docs/Untitled.png?raw=true)

Then, specify: the state, directory for the output, the bounding box and projection from above - and hit go! That's it.

```python
Expand Down
5 changes: 5 additions & 0 deletions conda/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir %SP_DIR%\map2loop
copy %RECIPE_DIR%\..\LICENSE %SP_DIR%\map2loop\
copy %RECIPE_DIR%\..\README.md %SP_DIR%\map2loop\
copy %RECIPE_DIR%\..\dependencies.txt %SP_DIR%\map2loop\
%PYTHON% -m pip install .
6 changes: 6 additions & 0 deletions conda/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
mkdir -p $SP_DIR/map2loop
cp $RECIPE_DIR/../dependencies.txt $SP_DIR/map2loop/
cp $RECIPE_DIR/../LICENSE $SP_DIR/map2loop/
cp $RECIPE_DIR/../README.md $SP_DIR/map2loop/
$PYTHON -m pip install .
85 changes: 0 additions & 85 deletions conda/conda-build.py

This file was deleted.

6 changes: 0 additions & 6 deletions conda/conda_build_config.yaml

This file was deleted.

Loading