Skip to content

Commit

Permalink
Update tree_graph.py (#53)
Browse files Browse the repository at this point in the history
* Update tree_graph.py

Panda 2.0.3 no longer supports column.iteritems() and requires to the generic use of column.items()

* updates to make compliance with Matplotlib 3.8

updates to make compliance with Matplotlib 3.8

* updates to support matplotlib 3.8

updated to change set_horizontalalignment('left') to set_tick_params(left = 'true')

* matplotlib 3.8 changes

matplotlib 3.8 changes

* Delete .DS_Store

* Delete pyfair/report/.DS_Store

* Update to support matplotlib 3.8

* Update .gitignore

---------

Co-authored-by: Corey Neskey <4606261+cneskey@users.noreply.github.com>
  • Loading branch information
CoronaBeachIDme and cneskey authored Feb 22, 2024
1 parent f0014c1 commit 614b08b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyfair/report/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ def generate_image(self):
space = np.linspace(0, xmax, 1000)
tyax.plot(space, beta_curve.pdf(space))
plt.margins(0)
return (fig, ax)
return (fig, ax)
3 changes: 2 additions & 1 deletion pyfair/report/exceedence.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def _generate_loss_curve(self, name, ax, space, loss_expectancy):
ax.axes.yaxis.set_major_formatter(StrMethodFormatter('{x:,.0f}%'))
ax.axes.xaxis.set_major_formatter(StrMethodFormatter(self._currency_prefix + '{x:,.0f}'))
ax.axes.xaxis.set_tick_params(rotation=-45)
ax.axes.xaxis.set_tick_params(left = 'true')
for tick in ax.axes.xaxis.get_major_ticks():
tick.label1.set_horizontalalignment('left')
ax.axes.set_title('Loss Exceedence Curve', fontsize=20)
ax.axes.set_title('Loss Exceedence Curve', fontsize=20)
7 changes: 2 additions & 5 deletions pyfair/report/tree_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import pandas as pd

import matplotlib
import matplotlib.pyplot as plt

from matplotlib.patches import Patch
from matplotlib.patches import Rectangle
from matplotlib.collections import PatchCollection
Expand Down Expand Up @@ -126,7 +124,7 @@ def _generate_text(self, row, ax):
supplied = row['status'] == 'Supplied'
# Raw inputs will have a list
if 'raw' in row.index:
if type(row['raw']) == list:
if isinstance(row['raw'], list):
raw = True
else:
raw = False
Expand All @@ -142,7 +140,6 @@ def _generate_text(self, row, ax):
output = '\n'.join([
key + ' ' + value.rjust(value_just)
for key, value

in data.items()
])
elif supplied:
Expand Down Expand Up @@ -225,4 +222,4 @@ def generate_image(self):
self._generate_rects(ax)
self._data.apply(self._generate_lines, args=[ax], axis=1)
self._generate_legend(ax)
return (fig, ax)
return (fig, ax)

0 comments on commit 614b08b

Please sign in to comment.