Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@domfournier
Copy link
Contributor

@domfournier domfournier commented Dec 27, 2023

Addresses name change for functions in utils.model_builder.
Update tutorials, examples and tests that were using the deprecated functions.

Related to issue #1265

@codecov
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (0cdda50) 82.35% compared to head (e425c33) 82.34%.

Files Patch % Lines
...lectromagnetics/natural_source/utils/test_utils.py 0.00% 1 Missing ⚠️
...mPEG/electromagnetics/static/utils/static_utils.py 50.00% 1 Missing ⚠️
SimPEG/utils/model_builder.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1311      +/-   ##
==========================================
- Coverage   82.35%   82.34%   -0.01%     
==========================================
  Files         165      165              
  Lines       25239    25228      -11     
==========================================
- Hits        20785    20774      -11     
  Misses       4454     4454              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@domfournier domfournier changed the title Issue 1265 Issue-1265: Fix deprecation warnings Dec 29, 2023
Copy link
Member

@santisoler santisoler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @domfournier for this! I've started working on ditching deprecated function in https://github.com/simpeg/simpeg/tree/ditch-deprecated (I'll open a PR shortly). I haven't worked on these functions yet, so these changes are greatly appreciated.

I just pushed a few commits to this branch to remove the deprecated functions, and also update some bits that were still using the deprecated functions. Hopefully CI won't fail. In case it does fail, feel free to push further changes.

@domfournier
Copy link
Contributor Author

domfournier commented Jan 2, 2024

Great @santisoler , getting cleaner. I have noticed some random failures of the dask.dc test though. It also happened to other PRs, so not related to this PR. Created issue #1315 to investigate. I would suggest we just re-fire the test here until it passes.

@santisoler
Copy link
Member

Thanks for opening that issue. If the test involves some random numbers, the failing might be related to #1289

@santisoler
Copy link
Member

Now tests passed. I'm merging this!

@santisoler santisoler changed the title Issue-1265: Fix deprecation warnings Ditch deprecated functions in utils.model_builder Jan 3, 2024
@santisoler santisoler merged commit 182ef1e into main Jan 3, 2024
thibaut-kobold added a commit to thibaut-kobold/simpeg that referenced this pull request Jan 3, 2024
* ta/weighting_strategy:
  fix new depreciation
  Ditch deprecated functions in utils.model_builder (simpeg#1311)
  more warnings
  move warning
  try fix `| None` test error
  stacklevel
  fix tests
  address comments
  One more randn
  switch tutorials rand to randn
@domfournier domfournier deleted the ISSUE-1265 branch January 13, 2024 16:09
@Hghadjari
Copy link

Hghadjari commented Mar 26, 2024

Can you help me to find what is the error?
mesh = refine_tree_xyz(
/home/hossein/anaconda3/envs/simpeg1/lib/python3.12/site-packages/scipy/interpolate/_interpolate.py:710: RuntimeWarning: invalid value encountered in divide
slope = (y_hi - y_lo) / (x_hi - x_lo)[:, None]
Traceback (most recent call last):
File "/home/hossein/simpeg/plot_fwd_2_dcr2d.py", line 126, in
mesh = refine_tree_xyz(
^^^^^^^^^^^^^^^^
File "/home/hossein/anaconda3/envs/simpeg1/lib/python3.12/site-packages/discretize/utils/mesh_utils.py", line 837, in refine_tree_xyz
r, ind = tree.query(newLoc)
^^^^^^^^^^^^^^^^^^
File "_ckdtree.pyx", line 795, in scipy.spatial._ckdtree.cKDTree.query
ValueError: 'x' must be finite, check for nan or inf values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants