Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dioph/elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
dioph committed Mar 30, 2020
2 parents e334b96 + 39c9814 commit e091bee
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions elegant/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
MIN_FSIZE = 4


# ToDo: it seems that texts ever overlaps with curves. Maybe overlapping_with_gcurves is unnecessary
# ToDo: Remove trafos Ploss column


def matplotlib_coordpairs(curve):
coords = np.array(curve.coords)
x = coords[:, 1]
Expand Down Expand Up @@ -252,7 +248,7 @@ def create_report(system, curves, grid, filename):
now = datetime.datetime.now()
doc.append('Report auto-generated by Elegant at '
'{:02d}/{:02d}/{:02d} {:02d}:{:02d}:{:02d}'.format(
now.day, now.month, now.year, now.hour, now.minute, now.second))
now.day, now.month, now.year, now.hour, now.minute, now.second))
wye_comm = UnsafeCommand('newcommand', '\\wye',
extra_arguments=r'\mathbin{\text{\begin{tikzpicture}[x=1pt, y=1pt, scale=2]'
r'\draw '
Expand Down Expand Up @@ -380,20 +376,20 @@ def create_report(system, curves, grid, filename):
NoEscape('{:.02f}'.format(np.abs(lt.Ia) / lt.imax * 100))),
color=color)
with doc.create(Section('Trafos')):
with doc.create(LongTable('c|cccccccc')) as tbl:
with doc.create(LongTable('c|ccccccc')) as tbl:
tbl.add_hline()
tbl.add_row((MultiRow(2, data='Trafo'),
MultiColumn(3, align='c', data='Parametrization'),
MultiColumn(2, align='c', data='Loss'),
MultiColumn(1, align='c', data='Loss'),
MultiColumn(3, align='c', data='Flow')))
tbl.add_hline(2, 9)
tbl.add_hline(2, 8)
tbl.add_row(('', NoEscape('$x^+$ (\\%pu)'), NoEscape('$x^0$ (\\%pu)'), 'Configuration',
NoEscape('$P_{loss}$ (MW)'), NoEscape('$Q_{loss}$ (Mvar)'),
NoEscape('$Q_{loss}$ (Mvar)'),
NoEscape('$P$ (MW)'), NoEscape('$Q$ (Mvar)'), NoEscape('$S/S_N$ (\\%)')))
tbl.add_hline()
tbl.end_table_header()
tbl.add_hline()
tbl.add_row((MultiColumn(9, align='r', data='Continued on Next Page'),))
tbl.add_row((MultiColumn(8, align='r', data='Continued on Next Page'),))
tbl.add_hline()
tbl.end_table_footer()
tbl.add_hline()
Expand All @@ -408,7 +404,6 @@ def create_report(system, curves, grid, filename):
NoEscape('{:.02f}'.format(tr.Z1.imag * 100)),
NoEscape('{:.02f}'.format(tr.Z0.imag * 100)),
get_scheme(tr),
NoEscape('{:.02f}'.format(tr.Sper.real * 100)),
NoEscape('{:.02f}'.format(tr.Sper.imag * 100)),
NoEscape('{:.02f}'.format(tr.S2.real * 100)),
NoEscape('{:.02f}'.format(tr.S2.imag * 100)),
Expand Down

0 comments on commit e091bee

Please sign in to comment.