Skip to content

Commit

Permalink
Merge pull request #11 from jpvantassel/dev
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
jpvantassel authored Jan 27, 2021
2 parents 4c21452 + 4d489da commit 8ca4f73
Show file tree
Hide file tree
Showing 16 changed files with 325 additions and 285 deletions.
62 changes: 43 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
version: 2
version: 2.1

orbs:
coverage-reporter: codacy/coverage-reporter@7.6.7
codecov: codecov/codecov@1.0.2

workflows:
version: 2
test:
build:
jobs:
- test-3.6
- test-3.7
- test-3.8
# - test-3.9
- test-36:
context:
- docker
- test-37:
context:
- docker
- test-38:
context:
- docker
# - test-39:
# context:
# - docker

jobs:
test-3.6: &test-template
test-36: &test-template
docker:
- image: circleci/python:3.6.9
auth:
username: jpvantassel
password: $DOCKER_PASS
working_directory: ~/repo
steps:
- checkout
Expand All @@ -26,7 +42,7 @@ jobs:
. venv/bin/activate
pip install numpy==1.18.5
- run:
name: Install SigProPy
name: Install sigpropy from source
command: |
. venv/bin/activate
pip install git+ssh://git@github.com/jpvantassel/sigpropy.git
Expand All @@ -47,27 +63,35 @@ jobs:
. venv/bin/activate
mv test/.coverage test-results
cd test-results
coverage xml -o coverage.xml
coverage xml -o cobertura.xml
- store_test_results:
path: test-results
- store_artifacts:
path: test-results
- run:
name: Call Codecov
command: |
. venv/bin/activate
pip install codecov
codecov
- codecov/upload:
file: test-results/cobertura.xml
- coverage-reporter/send_report

test-3.7:
test-37:
<<: *test-template
docker:
- image: circleci/python:3.7.5
test-3.8:
auth:
username: jpvantassel
password: $DOCKER_PASS

test-38:
<<: *test-template
docker:
- image: circleci/python:3.8.0
# test-3.9:
auth:
username: jpvantassel
password: $DOCKER_PASS

# test-39:
# <<: *test-template
# docker:
# - image: circleci/python:3.9.0
# auth:
# username: jpvantassel
# password: $DOCKER_PASS
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs/* linguist-documentation
*.ipynb linguist-documentation
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[![CircleCI](https://circleci.com/gh/jpvantassel/hvsrpy.svg?style=svg)](https://circleci.com/gh/jpvantassel/hvsrpy)
[![Documentation Status](https://readthedocs.org/projects/hvsrpy/badge/?version=latest)](https://hvsrpy.readthedocs.io/en/latest/?badge=latest)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/jpvantassel/hvsrpy.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jpvantassel/hvsrpy/context:python)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/528737ade629492e8652be369528c756)](https://www.codacy.com/manual/jpvantassel/hvsrpy?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jpvantassel/hvsrpy&amp;utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/jpvantassel/hvsrpy/branch/master/graph/badge.svg)](https://codecov.io/gh/jpvantassel/hvsrpy)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/528737ade629492e8652be369528c756)](https://www.codacy.com/gh/jpvantassel/hvsrpy/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jpvantassel/hvsrpy&amp;utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/jpvantassel/hvsrpy/branch/master/graph/badge.svg?token=MJ3WDNRIM0)](https://codecov.io/gh/jpvantassel/hvsrpy)

## Table of Contents

Expand Down
4 changes: 4 additions & 0 deletions hvsrpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@

"""Import modules into the hvsrpy namespace."""

import logging

from .meta import __version__
from .hvsr import Hvsr
from .hvsr_rotated import HvsrRotated
from .sensor3c import Sensor3c
from .plottools import quick_plot
from .hvsr_spatial import HvsrVault, montecarlo_f0

logging.getLogger('swprocess').addHandler(logging.NullHandler())
3 changes: 2 additions & 1 deletion hvsrpy/hvsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

from .meta import __version__

logger = logging.getLogger(name=__name__)
logger = logging.getLogger("swprocess.hvsr")

__all__ = ["Hvsr"]

class Hvsr():
"""Class for creating and manipulating HVSR objects.
Expand Down
8 changes: 5 additions & 3 deletions hvsrpy/hvsr_rotated.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from hvsrpy import Hvsr, __version__

logger = logging.getLogger(__name__)
logger = logging.getLogger("swprocess.hvsr_rotated")

__all__ = ["HvsrRotated"]

Expand Down Expand Up @@ -378,7 +378,8 @@ def mc_peak_amp(self, distribution='lognormal'):
"""
mc = self.mean_curve(distribution)
mc = mc.reshape((1, mc.size))
return np.max(mc[0, Hvsr.find_peaks(mc)[0]])
i_low, i_high = self.hvsrs[0].i_low, self.hvsrs[0].i_high
return np.max(mc[0, Hvsr.find_peaks(mc[:, i_low:i_high], starting_index=i_low)[0]])

def mc_peak_frq(self, distribution='lognormal'):
"""Frequency of the peak of the mean HVSR curve.
Expand All @@ -396,7 +397,8 @@ def mc_peak_frq(self, distribution='lognormal'):
"""
mc = self.mean_curve(distribution)
mc = mc.reshape((1, mc.size))
return float(self.frq[np.where(mc[0] == np.max(mc[0, Hvsr.find_peaks(mc)[0]]))])
i_low, i_high = self.hvsrs[0].i_low, self.hvsrs[0].i_high
return self.frq[i_low + int(np.where(mc[0, i_low:i_high] == np.max(mc[0, Hvsr.find_peaks(mc[:, i_low:i_high], starting_index=i_low)[0]]))[0])]

def _stats(self, distribution_f0):
distribution_f0 = Hvsr.correct_distribution(distribution_f0)
Expand Down
2 changes: 1 addition & 1 deletion hvsrpy/hvsr_spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from scipy.spatial import Voronoi
from shapely.geometry import MultiPoint, Point, Polygon

logger = logging.getLogger(name=__name__)
logger = logging.getLogger("swprocess.hvsr_rotated")

__all__ = ["montecarlo_f0", "HvsrVault"]

Expand Down
2 changes: 1 addition & 1 deletion hvsrpy/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

"""Metadata for hvsrpy."""

__version__ = "0.5.0"
__version__ = "0.5.1"
2 changes: 2 additions & 0 deletions hvsrpy/plottools.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

import hvsrpy

__all__ = ["quick_plot", "quick_voronoi_plot"]


def quick_plot(file_name, windowlength=60, width=0.1, bandwidth=40,
minf=0.2, maxf=20, nf=128, res_type="log",
Expand Down
Loading

0 comments on commit 8ca4f73

Please sign in to comment.