Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down Expand Up @@ -137,7 +137,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pyfair.tex', 'pyfair Documentation',
'Hive Systems', 'manual'),
'Derive', 'manual'),
]


Expand Down
2 changes: 1 addition & 1 deletion pyfair/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1-alpha.12"
__version__ = "0.1-alpha.14"
16 changes: 13 additions & 3 deletions pyfair/report/base_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()))
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -18,16 +18,16 @@
"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",
"pyfair.report",
"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",
Expand Down
Loading