Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetics Bugs #152

Merged
merged 43 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1751f4c
fix synthetic wavelet issue and as_curve bug
hyperiongeo Feb 13, 2021
fc6c720
remove whitespace
hyperiongeo Mar 13, 2021
a932c1e
Updated Code of Conduct
kwinkunks Mar 24, 2022
1ced65d
Merge branch 'develop' into main
kwinkunks Apr 7, 2022
b4794d7
Update defaults.py
ThomasMGeo Jun 7, 2022
4383ad2
Correct DC Slagel's organization and location.
dcslagel Jun 17, 2022
5dcae74
Merge branch 'develop'
kwinkunks Apr 18, 2023
667c783
make defaults on global namespace
WesleyTheGeolien May 15, 2023
480ca8a
Remove Py 3.6 from CI and update actions
kwinkunks May 15, 2023
b3896de
Merge pull request #229 from agilescientific/update-actions-drop-36
kwinkunks May 15, 2023
ab991bf
Merge pull request #228 from WesleyTheGeolien/main
kwinkunks May 15, 2023
b715971
Merge pull request #222 from dcslagel/patch-1
kwinkunks May 15, 2023
f3c06c8
Merge pull request #221 from ThomasMGeo/patch-6
kwinkunks May 15, 2023
7711c5e
Merge branch 'main' into synthetics2021
hyperiongeo Feb 24, 2024
a13c5e9
[fix] Plot 2D curve: Merge paths instead of using the first path retu…
NicolasCami Apr 22, 2024
16a1d3f
[fix] Fix typo
NicolasCami Apr 22, 2024
088d871
Fixed a bug where lasio no longer has the method add_curve. It has be…
gavargas22 May 1, 2024
ad33980
Update curve.py
gavargas22 Jun 24, 2024
b055b3e
Update curve.py
gavargas22 Aug 16, 2024
8178229
use pyproject.toml for build specification
frank1010111 Nov 27, 2024
47d3dac
use importlib to get version, replacing pkg_resources
frank1010111 Nov 27, 2024
1a0ddf0
set pytest arguments in pyproject.toml
frank1010111 Nov 27, 2024
844e728
add test for automatic object dtype conversion
frank1010111 Nov 27, 2024
9af76ba
pass test for automatic object dtype conversion
frank1010111 Nov 27, 2024
e87ec1e
use pytest rather than script in CI
frank1010111 Nov 27, 2024
02d74b6
test on python versions 3.9-3.13
frank1010111 Nov 27, 2024
5a01e77
Merge pull request #237 from gavargas22/fix/lasio-append-curve-bug
frank1010111 Nov 29, 2024
facad63
Merge pull request #239 from gavargas22/fix/curve_deprecated_access
frank1010111 Nov 29, 2024
4c9ea5c
test on python versions 3.9-3.13
frank1010111 Nov 27, 2024
c07ee4e
test on pull requests to main
frank1010111 Nov 29, 2024
c14263e
use pytest rather than script in CI
frank1010111 Nov 27, 2024
0277e0b
Merge pull request #240 from frank1010111/importlib-and-hatch
frank1010111 Dec 7, 2024
6303139
Merge branch 'main' into pandas-deprecation
frank1010111 Dec 7, 2024
d913214
fix categorical curve basis changes
frank1010111 Dec 7, 2024
5477513
tests: change baseline for curve_2d
frank1010111 Dec 7, 2024
3e9ea97
Merge pull request #236 from NicolasCami/fix-plot-2d-curve
frank1010111 Dec 7, 2024
306e4b2
Merge pull request #241 from frank1010111/pandas-deprecation
frank1010111 Dec 7, 2024
2c7aac4
Merge branch 'main' into synthetics2021
frank1010111 Dec 15, 2024
3edcb3a
Update as_curve and add unit test
hyperiongeo Dec 15, 2024
b98864b
Merge branch 'synthetics2021' of https://github.com/hyperiongeo/welly…
hyperiongeo Dec 15, 2024
daeea4c
tests: fix generation of synthetic plots that don't return axes
frank1010111 Dec 28, 2024
ca4d4fd
bugfix: stop is calculated in Synthetic
frank1010111 Dec 28, 2024
022da34
tests: new, maybe more correct well_synthetic plot
frank1010111 Dec 28, 2024
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
13 changes: 6 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Run tests

on:
push:
branches: [ develop, master ]
branches: [ develop, main ]
pull_request:
branches: [ develop ]
branches: [ develop, main ]

jobs:
build:
Expand All @@ -16,18 +16,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with pytest
run: |
python run_tests.py
run: pytest
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ The following people have contributed to the project (in alphabetical order):
- [Thomas Martin](https://github.com/ThomasMGeo), Colorado, USA
- [Steve Purves](https://github.com/stevejpurves), Curvenote, Spain
- [Patrick Reinhard](https://github.com/patrick-reinhard), Shell, The Netherlands
- [DC Slagel](https://github.com/dcslagel), Shell, The Netherlands
- [DC Slagel](https://github.com/dcslagel), Code Farm, Colorado, USA
- [Miguel de la Varga](https://github.com/Leguark), Germany
- [Wenting Xiong](https://github.com/wenting-x), Shell, The Netherlands
79 changes: 79 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Racist or racially biased remarks, attacks, or content.
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting any of the following people:

- Matt Hall, [[email protected]](mailto:[email protected])
- Evan Bianco, [[email protected]](mailto:[email protected])

All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
63 changes: 57 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,62 @@
[build-system]
requires = [
"setuptools>=48",
"setuptools_scm[toml] >= 4, <6",
"setuptools_scm_git_archive",
"wheel >= 0.29.0",
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "welly"
dynamic = ["version"]
authors = [{ name = "The Welly Authors", email = "[email protected]" }]
description = "Tools for making and managing well data."
readme = "README.md"
readme-content-type = "text/markdown"
homepage = "https://github.com/agilescientific/welly"
classifiers = [
"Intended Audience :: Science/Research",
"Development Status :: 4 - Beta",
"Natural Language :: English",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent"
]
dependencies = [
"numpy",
"scipy",
"pandas",
"matplotlib",
"lasio",
"striplog",
"tqdm",
"wellpathpy",
"requests"
]

[project.optional-dependencies]
docs = ["sphinx", "sphinxcontrib-apidoc", "myst_nb", "furo"]
test = ["pytest", "pytest-cov", "pytest-mpl"]
dev = ["build", "pytest", "pytest-cov", "pytest-mpl", "sphinx", "sphinxcontrib-apidoc", "myst_nb", "furo"]

[tool.hatch.metadata]
packages = ["welly"]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "_version.py"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = [
"--cov=welly",
"--cov-config=pyproject.toml",
"--mpl",
"--mpl-baseline-path=tests/baseline",
]
build-backend = "setuptools.build_meta"
testpaths = ["tests"]

[tool.setuptools_scm]
write_to = "welly/_version.py"
Expand Down
20 changes: 0 additions & 20 deletions run_tests.py

This file was deleted.

39 changes: 0 additions & 39 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

Binary file modified tests/baseline/test_curve_2d_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline/test_well_synthetic_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

https://pypi.python.org/pypi/pytest-mpl/0.3
"""
import matplotlib.pyplot as plt
import pytest

from welly import Well
Expand Down Expand Up @@ -114,7 +115,8 @@ def test_synthetic_plot():
test_params = {'dt': 0.004}
s = Synthetic(data, params=test_params)

fig = s.plot().get_figure()
fig, ax = plt.subplots(figsize=(2, 10))
s.plot(ax)

return fig

Expand All @@ -127,7 +129,8 @@ def test_well_synthetic_plot():
w = Well.from_las(FNAME)
w.make_synthetic()

fig = w.data['Synthetic'].plot().get_figure()
fig, ax = plt.subplots(figsize=(2, 10))
w.data['Synthetic'].plot(ax)

return fig

Expand Down
17 changes: 16 additions & 1 deletion tests/test_synthetic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf 8 -*-
"""
Define a suite a tests for the Curve module.
Define a suite a tests for the Synthetic class.
"""
import numpy as np

Expand All @@ -17,3 +17,18 @@ def test_synthetic():

assert s.dt == 0.004
assert s.name == 'Synthetic'


def test_synthetic_as_curve():
"""
Test synthetic to curve.
"""
data = np.array([4, 2, 0, -4, -2, 1, 3, 6, 3, 1, -2, -5, -1, 0])
params = {'dt': 0.004}
s = Synthetic(data, params=params)

crv = s.as_curve(0, 500, 0.1, mnemonic="SYNTH_CRV")

assert crv.index[0] == 0
assert round((crv.index[1]-crv.index[0]),2) == 0.1
assert crv.mnemonic == 'SYNTH_CRV'
10 changes: 10 additions & 0 deletions tests/test_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import os
from pathlib import Path

import pandas as pd

import welly
from welly import Well

Expand Down Expand Up @@ -148,3 +150,11 @@ def test_iter_well(well):
for curve in well:
assert curve == well.data['CALI']
break

def test_df_object_cols(df):

df["Test object"] = "54"
df["test_str"] = '1z'
well = Well.from_df(df)
assert all(well.df()["Test object"] == 54)
assert all(well.df()["test_str"] == "1z")
24 changes: 10 additions & 14 deletions welly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
welly
==================
"""
import sys

from .project import Project
from .well import Well
from .header import Header
Expand All @@ -12,6 +14,7 @@
from .crs import CRS
from . import tools
from . import quality
from . import defaults


def read_las(path, **kwargs):
Expand Down Expand Up @@ -66,17 +69,10 @@ def read_df(df, **kwargs):
]


from pkg_resources import get_distribution, DistributionNotFound

try:
VERSION = get_distribution(__name__).version
except DistributionNotFound:
try:
from ._version import version as VERSION
except ImportError:
raise ImportError(
"Failed to find (autogenerated) _version.py. "
"This might be because you are installing from GitHub's tarballs, "
"use the PyPI ones."
)
__version__ = VERSION
if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

__version__ = metadata.version(__name__)

Loading
Loading