Skip to content

Commit

Permalink
Merge pull request #238 from WEgeophysics/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
earthai-tech authored Mar 9, 2024
2 parents cab18b7 + 99e2a96 commit 4d2695e
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 31 deletions.
9 changes: 7 additions & 2 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[
{
"name": "dev",
"version": "v0.3.2",
"version": "v0.3.3",
"url": "https://watex.readthedocs.io/en/latest/"
},
{
"name": "0.3.2 (stable)",
"version": "v0.3.1",
"url": "https://watex.readthedocs.io/en/0.3.2/"
},
{
"name": "0.3.1 (stable)",
"name": "0.3.1",
"version": "v0.3.1",
"url": "https://watex.readthedocs.io/en/0.3.1/"
},
Expand Down
15 changes: 12 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,26 @@
html_static_path = ['_static', 'example_thumbs']
html_css_files = ["css/custom.css"] #?v={watex.__version__} query removed.



# todo_include_todos = True
html_logo = "_static/logo.svg"
html_favicon = "_static/favicon.ico"

# Define the json_url for our version switcher.
json_url = "https://watex.readthedocs.io/en/latest/_static/switcher.json"

# Define the json_url for our version switcher.
json_url = "https://watex.readthedocs.io/en/latest/_static/switcher.json"

# Define the version we use for matching in the version switcher.
# Here we need to ensure that the version_match corresponds to our stable version
version_match = f"v{watex.__version__}" #"v0.3.1" # This should match the version key in your switcher.json for the stable version

# Use this if you want to set the switcher version from the environment or
# default to the provided stable version
# version_match = os.environ.get("READTHEDOCS_VERSION", "v0.3.1")

# Define the version we use for matching in the version switcher.
version_match = os.environ.get("READTHEDOCS_VERSION", f"v{watex.__version__}")
#version_match = os.environ.get("READTHEDOCS_VERSION", f"v{watex.__version__}")
# If READTHEDOCS_VERSION doesn't exist, we're not on RTD
# If it is an integer, we're in a PR build and the version isn't correct.

Expand Down
1 change: 1 addition & 0 deletions docs/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Version 0.3
.. toctree::
:maxdepth: 2

v0.3.2
v0.3.1
v0.3.0

Expand Down
18 changes: 18 additions & 0 deletions docs/whatsnew/v0.3.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
v0.3.2 (March 9, 2024)
-----------------------

Minor changes have been made to the API since version ``v0.3.1``, leading
to fixed bugs in frequencies handling.

- |Fix| Fixed the bound error in :meth:`~watex.methods.MT.remove_static_shift` by
rounding the frequency checks to 5 decimal places.

- |Fix| There is no longer a need to recompute frequencies when no extraneous
frequencies are detected for omission. :meth:`~watex.methods.MT.drop_frequencies`
now consistently returns the original :term:`MT` object.






2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "watex"
version = "0.3.1"
version = "0.3.2"
description = "Machine learning research in water exploration"
readme = "README.md"
authors = [{name = "Laurent Kouadio", email = "etanoyau@gmail.com"}]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
try:
import watex
VERSION = watex.__version__
except: VERSION ='0.3.1'
except: VERSION ='0.3.2'
# set global variables
DISTNAME = "watex"
DESCRIPTION= "Machine learning research in water exploration"
Expand Down
2 changes: 1 addition & 1 deletion watex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from . import _version
__version__ = _version.version.split('.dev')[0]
except ImportError:
__version__ = "0.3.1"
__version__ = "0.3.2"

# # set loging Level
logging.getLogger(__name__)#.setLevel(logging.WARNING)
Expand Down
2 changes: 1 addition & 1 deletion watex/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '0.3.1.dev1+g10707dc.d20230709'
__version__ = version = '0.3.2.dev1+g10707dc.d20230709'
__version_tuple__ = version_tuple = (0, 3, 2, 'dev1', 'g10707dc.d20230709')
49 changes: 27 additions & 22 deletions watex/methods/em.py
Original file line number Diff line number Diff line change
Expand Up @@ -4277,7 +4277,6 @@ def _update_z (z_or_edis, /, ufunc , args =(), **kws ):

return new_zObjs


def drop_frequencies (
ediObjs: List[EDIO] | os.PathLike, /,
tol:float ="auto",
Expand Down Expand Up @@ -4370,7 +4369,7 @@ def drop_frequencies (
raise EMError (
"tolerance parameter or frequency values to discard"
" could not be None. Consider ``tol='auto'``to"
" automatically control 50% quality of the data."
" automatically control 50% quality of the data."
)

if str(tol).lower() == 'auto':
Expand Down Expand Up @@ -4400,29 +4399,35 @@ def drop_frequencies (
# for consistency
freqs = np.sort (freqs )[::-1 ]

if len(freqs)==0 and verbose:
print(f"Noise frequencies for {tol*100}% tolerance"
" have not been detected.")
else: listing_items_format(freqs ,begintext= "Frequencies" ,
if len(freqs)==0:
if verbose:
print(f"Noise frequencies for {tol*100}% tolerance"
" have not been detected.")
# return object and frequency list
freqslist = [ edio.Z._freq for edio in ediObjs ]
Zobj = [ edio.Z for edio in ediObjs ]

else:
listing_items_format(freqs ,begintext= "Frequencies" ,
endtext="Hz have been dropped.",
inline =True , verbose =verbose
)
# use mask to set a new collection of Z
Zobj = []; freqslist=[]
for kk , edio in enumerate (ediObjs ):
mask = np.isin ( edio.Z._freq, freqs)
# mask = np.ones ( len( edio.Z._freq), dtype = bool )
# mask [ u_freqs] = False
z_new = edio.Z._z [~mask , :, :]
# similar to np.delete (edio.Z._z , u_freqs, axis =0 )
z_err_new = edio.Z._z_err [~mask , :, :]
new_freq = edio.Z._freq[ ~mask ]

Z =EMz (
z_array= z_new , z_err_array= z_err_new , freq = new_freq
)
Zobj.append(Z )
freqslist.append (new_freq)
# use mask to set a new collection of Z
Zobj = []; freqslist=[]
for kk , edio in enumerate (ediObjs ):
mask = np.isin ( edio.Z._freq, freqs)
# mask = np.ones ( len( edio.Z._freq), dtype = bool )
# mask [ u_freqs] = False
z_new = edio.Z._z [~mask , :, :]
# similar to np.delete (edio.Z._z , u_freqs, axis =0 )
z_err_new = edio.Z._z_err [~mask , :, :]
new_freq = edio.Z._freq[ ~mask ]
Z =EMz (
z_array= z_new , z_err_array= z_err_new , freq = new_freq
)
Zobj.append(Z )
freqslist.append (new_freq)

if get_max_freqs:
freqslist = freqslist [
Expand Down

0 comments on commit 4d2695e

Please sign in to comment.