diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3da4953..0000000 --- a/.travis.yml +++ /dev/null @@ -1,2 +0,0 @@ -language: python -script: python ./tests/test_runner.py diff --git a/docs/conf.py b/docs/conf.py index f18466a..e99d3c4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,13 +19,13 @@ # -- Project information ----------------------------------------------------- project = 'pyfair' -copyright = '2023, Hive Systems, LLC' -author = 'Hive Systems' +copyright = '2023-2026, Quant LLC' +author = 'Derive' # The short X.Y version -version = '0.1.12' +version = '0.1.14' # The full version, including alpha/beta/rc tags -release = '0.1-alpha.12' +release = '0.1-alpha.14' # -- General configuration --------------------------------------------------- @@ -137,7 +137,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'pyfair.tex', 'pyfair Documentation', - 'Hive Systems', 'manual'), + 'Derive', 'manual'), ] diff --git a/pyfair/_version.py b/pyfair/_version.py index 2a3adcf..62d6dde 100644 --- a/pyfair/_version.py +++ b/pyfair/_version.py @@ -1 +1 @@ -__version__ = "0.1-alpha.12" +__version__ = "0.1-alpha.14" diff --git a/pyfair/report/base_report.py b/pyfair/report/base_report.py index 2692412..a582f78 100644 --- a/pyfair/report/base_report.py +++ b/pyfair/report/base_report.py @@ -22,6 +22,14 @@ from ..utility.beta_pert import FairBetaPert +def _dataframe_elementwise(df, func): + """Element-wise transform; pandas 2.1+ uses map, older uses applymap.""" + applymap = getattr(df, "applymap", None) + if applymap is not None: + return applymap(func) + return df.map(func) + + class FairBaseReport(object): """A base class for creating FairModel and FairMetaModel reports @@ -262,8 +270,8 @@ def _get_overview_table(self, model_or_models): risk_results = risk_results.agg(["mean", "std", "min", "max"]) risk_results.index = ["Mean", "Stdev", "Minimum", "Maximum"] # Format risk results into dataframe - overview_df = risk_results.applymap( - lambda x: self._format_strings["Risk"].format(x) + overview_df = _dataframe_elementwise( + risk_results, lambda x: self._format_strings["Risk"].format(x) ) overview_df.loc["Simulations"] = [ "{0:,.0f}".format(len(model.export_results())) @@ -321,7 +329,9 @@ def _get_model_parameter_table(self, model): # On a column basis axis=1, ) - param_df = param_df.applymap(lambda x: "" if "nan" in x else x) + param_df = _dataframe_elementwise( + param_df, lambda x: "" if "nan" in x else x + ) # Do not truncate our base64 images. pd.set_option("display.max_colwidth", None) # Create our distribution icons as strings in table diff --git a/setup.py b/setup.py index 2778755..f03bf39 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="pyfair", - version="0.1-alpha.13", + version="0.1-alpha.14", description="Open FAIR Monte Carlo creator", long_description=""" Factor Analysis of Information Risk (Open FAIR) model in Python. @@ -18,8 +18,8 @@ "Open FAIR" is a trademark of the Open Group. """, - author="Hive Systems", - author_email="pyfair@hivesystems.com", + author="Derive", + author_email="pyfair@deriverisk.com", packages=[ "pyfair", "pyfair.model", @@ -27,7 +27,7 @@ "pyfair.utility", ], license="MIT", - url="https://github.com/Hive-Systems/pyfair", + url="https://github.com/Derive-Risk/pyfair", keywords=["FAIR", "risk", "monte carlo", "cyber risk", "risk analysis"], classifiers=[ "Development Status :: 3 - Alpha",