Skip to content

Commit

Permalink
feat(sound): add sound prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
RDWimmers committed Nov 13, 2023
1 parent 4d06271 commit 20aa42d
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 53 deletions.
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dependencies = [
"pygef",
"cems-nuclei==0.4.0.b2",
"geopandas",
"pyogrio"
"pyogrio",
"scipy"
]
license = { file = "LICENSE" }
readme = "README.md"
Expand Down Expand Up @@ -92,7 +93,8 @@ module = [
"shapely.*",
"pygef.*",
"mpl_toolkits.*",
"nuclei.*"
"nuclei.*",
"numpy.*"
]
ignore_missing_imports = true

Expand Down
36 changes: 27 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ gef-file-to-map==0.1.0
# via pygef
geographiclib==2.0
# via geopy
geopandas==0.14.0
geopandas==0.14.1
# via py-vibracore (pyproject.toml)
geopy==2.4.0
# via contextily
Expand All @@ -98,17 +98,24 @@ importlib-metadata==6.8.0
# via
# fiona
# sphinx
importlib-resources==6.1.0
importlib-resources==6.1.1
# via matplotlib
iniconfig==2.0.0
# via pytest
ipympl==0.9.3
# via py-vibracore (pyproject.toml)
ipython==8.11.0
# via
# black
# ipympl
# ipywidgets
# py-vibracore (pyproject.toml)
ipython-genutils==0.2.0
# via ipympl
ipywidgets==8.1.1
# via tqdm
# via
# ipympl
# tqdm
isort==5.12.0
# via py-vibracore (pyproject.toml)
jedi==0.19.1
Expand All @@ -128,6 +135,7 @@ markupsafe==2.1.3
matplotlib==3.8.1
# via
# contextily
# ipympl
# pygef
matplotlib-inline==0.1.6
# via ipython
Expand All @@ -144,15 +152,17 @@ mypy-extensions==1.0.0
# black
# mypy
# py-vibracore (pyproject.toml)
numpy==1.26.1
numpy==1.26.2
# via
# contourpy
# ipympl
# matplotlib
# pandas
# pandas-stubs
# pyarrow
# pyogrio
# rasterio
# scipy
# shapely
# snuggs
packaging==23.2
Expand All @@ -164,7 +174,7 @@ packaging==23.2
# pyogrio
# pytest
# sphinx
pandas==2.1.2
pandas==2.1.3
# via geopandas
pandas-stubs==2.1.1.230928
# via py-vibracore (pyproject.toml)
Expand All @@ -181,24 +191,25 @@ pickleshare==0.7.5
pillow==10.1.0
# via
# contextily
# ipympl
# matplotlib
platformdirs==3.5.1
# via
# black
# py-vibracore (pyproject.toml)
pluggy==1.3.0
# via pytest
polars[pyarrow]==0.19.12
polars[pyarrow]==0.19.13
# via
# polars
# pygef
prompt-toolkit==3.0.39
prompt-toolkit==3.0.40
# via ipython
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.2
# via stack-data
pyarrow==14.0.0
pyarrow==14.0.1
# via polars
pycodestyle==2.10.0
# via
Expand Down Expand Up @@ -239,14 +250,20 @@ requests==2.31.0
# cems-nuclei
# contextily
# coveralls
# requests-mock
# sphinx
requests-mock==1.11.0
# via py-vibracore (pyproject.toml)
scipy==1.11.3
# via py-vibracore (pyproject.toml)
shapely==2.0.2
# via geopandas
six==1.16.0
# via
# asttokens
# fiona
# python-dateutil
# requests-mock
snowballstemmer==2.2.0
# via sphinx
snuggs==1.4.7
Expand Down Expand Up @@ -296,12 +313,13 @@ tqdm[notebook]==4.66.1
traitlets==5.13.0
# via
# comm
# ipympl
# ipython
# ipywidgets
# matplotlib-inline
types-pytz==2023.3.1.1
# via pandas-stubs
types-tqdm==4.66.0.3
types-tqdm==4.66.0.4
# via py-vibracore (pyproject.toml)
typing-extensions==4.7.1
# via
Expand Down
6 changes: 0 additions & 6 deletions src/pyvibracore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
from ._version import __version__
from .input import impact_force_properties, vibration_properties
from .results import impact_force_result, vibration_result

__all__ = [
"__version__",
"impact_force_properties",
"impact_force_result",
"vibration_result",
"vibration_properties",
]
35 changes: 35 additions & 0 deletions src/pyvibracore/results/plot_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from __future__ import annotations

from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar


def _north_arrow(axes: plt.Axes) -> None:
"""Add north arrow to axes"""
x, y, arrow_length = 0.05, 0.98, 0.1
axes.annotate(
"N",
xy=(x, y),
xytext=(x, y - arrow_length),
arrowprops=dict(facecolor="black", width=5, headwidth=15),
ha="center",
va="center",
fontsize=20,
xycoords=axes.transAxes,
)


def _scalebar(axes: plt.Axes) -> None:
"""Add size bar to axes"""
scalebar = AnchoredSizeBar(
axes.transData,
20,
"20 m",
"lower left",
pad=1,
color="black",
frameon=True,
size_vertical=2,
)

axes.add_artist(scalebar)
Loading

0 comments on commit 20aa42d

Please sign in to comment.