-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take care of deprecation warnings from dependencies (#482)
- Loading branch information
Showing
19 changed files
with
157 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: estimagic | ||
channels: | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- pandas<2.0.0 | ||
- nlopt # dev, tests | ||
- pip # dev, tests, docs | ||
- pytest # dev, tests | ||
- pytest-cov # tests | ||
- pytest-xdist # dev, tests | ||
- statsmodels # dev, tests | ||
- bokeh<=2.4.3 # run, tests | ||
- click # run, tests | ||
- cloudpickle # run, tests | ||
- joblib # run, tests | ||
- numpy>=1.17.0 # run, tests | ||
- plotly # run, tests | ||
- pybaum >= 0.1.2 # run, tests | ||
- scipy>=1.2.1 # run, tests | ||
- sqlalchemy # run, tests | ||
- tranquilo>=0.0.4 # dev, tests | ||
- seaborn # dev, tests | ||
- pip: # dev, tests, docs | ||
- DFO-LS # dev, tests | ||
- Py-BOBYQA # dev, tests | ||
- fides==0.7.4 # dev, tests | ||
- kaleido # dev, tests | ||
- simoptlib==1.0.1 # dev, tests | ||
- -e ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Compatibility module. | ||
Contains wrapper functions to handle compatibility issues between different versions of | ||
external libraries. | ||
""" | ||
|
||
from estimagic.config import IS_PANDAS_VERSION_NEWER_OR_EQUAL_TO_2_1_0 | ||
|
||
|
||
def pd_df_map(df, func, na_action=None, **kwargs): | ||
"""Apply a function to a Dataframe elementwise. | ||
pandas has depricated the .applymap() function with version 2.1.0. This function | ||
calls either .map() (if pandas version is greater or equal to 2.1.0) or .applymap() | ||
(if pandas version is smaller than 2.1.0). | ||
Args: | ||
df (pd.DataFrame): A pandas DataFrame. | ||
func (callable): Python function, returns a single value from a single value. | ||
na_action (str): If 'ignore', propagate NaN values, without passing them to | ||
func. If None, pass NaN values to func. Default is None. | ||
**kwargs: Additional keyword arguments to pass as keywords arguments to func. | ||
Returns: | ||
pd.DataFrame: Transformed DataFrame. | ||
""" | ||
if IS_PANDAS_VERSION_NEWER_OR_EQUAL_TO_2_1_0: | ||
out = df.map(func, na_action=na_action, **kwargs) | ||
else: | ||
out = df.applymap(func, na_action=na_action, **kwargs) | ||
return out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.