Skip to content

Commit 31cff43

Browse files
authored
chore: Derive-Risk metadata after org transfer (#84)
* chore: Derive-Risk org metadata after repository transfer Update package and Sphinx author, homepage URL, and aligned 0.1-alpha.14 version strings. Remove legacy Travis CI config. * fix: use DataFrame.map for pandas 2.1+ (applymap removed) CI installs unpinned pandas; 3.11+ matrix jobs hit AttributeError on applymap. Require pandas>=2.1 where map replaced applymap. * fix: compat helper for DataFrame map vs applymap across pandas versions pandas 2.1+ removed applymap; Python 3.8 CI cannot install pandas>=2.1. Use applymap when present, else map. * fix: copyright Quant LLC; author branding Derive * chore: author_email pyfair@deriverisk.com
1 parent ac15b32 commit 31cff43

5 files changed

Lines changed: 23 additions & 15 deletions

File tree

.travis.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = 'pyfair'
22-
copyright = '2023, Hive Systems, LLC'
23-
author = 'Hive Systems'
22+
copyright = '2023-2026, Quant LLC'
23+
author = 'Derive'
2424

2525
# The short X.Y version
26-
version = '0.1.12'
26+
version = '0.1.14'
2727
# The full version, including alpha/beta/rc tags
28-
release = '0.1-alpha.12'
28+
release = '0.1-alpha.14'
2929

3030

3131
# -- General configuration ---------------------------------------------------
@@ -137,7 +137,7 @@
137137
# author, documentclass [howto, manual, or own class]).
138138
latex_documents = [
139139
(master_doc, 'pyfair.tex', 'pyfair Documentation',
140-
'Hive Systems', 'manual'),
140+
'Derive', 'manual'),
141141
]
142142

143143

pyfair/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1-alpha.12"
1+
__version__ = "0.1-alpha.14"

pyfair/report/base_report.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
from ..utility.beta_pert import FairBetaPert
2323

2424

25+
def _dataframe_elementwise(df, func):
26+
"""Element-wise transform; pandas 2.1+ uses map, older uses applymap."""
27+
applymap = getattr(df, "applymap", None)
28+
if applymap is not None:
29+
return applymap(func)
30+
return df.map(func)
31+
32+
2533
class FairBaseReport(object):
2634
"""A base class for creating FairModel and FairMetaModel reports
2735
@@ -262,8 +270,8 @@ def _get_overview_table(self, model_or_models):
262270
risk_results = risk_results.agg(["mean", "std", "min", "max"])
263271
risk_results.index = ["Mean", "Stdev", "Minimum", "Maximum"]
264272
# Format risk results into dataframe
265-
overview_df = risk_results.applymap(
266-
lambda x: self._format_strings["Risk"].format(x)
273+
overview_df = _dataframe_elementwise(
274+
risk_results, lambda x: self._format_strings["Risk"].format(x)
267275
)
268276
overview_df.loc["Simulations"] = [
269277
"{0:,.0f}".format(len(model.export_results()))
@@ -321,7 +329,9 @@ def _get_model_parameter_table(self, model):
321329
# On a column basis
322330
axis=1,
323331
)
324-
param_df = param_df.applymap(lambda x: "" if "nan" in x else x)
332+
param_df = _dataframe_elementwise(
333+
param_df, lambda x: "" if "nan" in x else x
334+
)
325335
# Do not truncate our base64 images.
326336
pd.set_option("display.max_colwidth", None)
327337
# Create our distribution icons as strings in table

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="pyfair",
5-
version="0.1-alpha.13",
5+
version="0.1-alpha.14",
66
description="Open FAIR Monte Carlo creator",
77
long_description="""
88
Factor Analysis of Information Risk (Open FAIR) model in Python.
@@ -18,16 +18,16 @@
1818
"Open FAIR" is a trademark of the Open Group.
1919
2020
""",
21-
author="Hive Systems",
22-
author_email="pyfair@hivesystems.com",
21+
author="Derive",
22+
author_email="pyfair@deriverisk.com",
2323
packages=[
2424
"pyfair",
2525
"pyfair.model",
2626
"pyfair.report",
2727
"pyfair.utility",
2828
],
2929
license="MIT",
30-
url="https://github.com/Hive-Systems/pyfair",
30+
url="https://github.com/Derive-Risk/pyfair",
3131
keywords=["FAIR", "risk", "monte carlo", "cyber risk", "risk analysis"],
3232
classifiers=[
3333
"Development Status :: 3 - Alpha",

0 commit comments

Comments
 (0)