Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:oscarbranson/latools into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarbranson committed Mar 28, 2023
2 parents c15bd07 + ebdc5aa commit 4329658
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9"]
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
16 changes: 8 additions & 8 deletions Supplement/comparison_tools/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def comparison_plots(df, els=['Mg', 'Sr', 'Ba', 'Al', 'Mn']):
ax.plot(xlim, xlim, c='k', ls='dashed', alpha=0.6)

for ax in axs[i]:
if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
hax.set_xlabel('Residual')
tax.set_xlabel('Reference User')
lax.set_xlabel('Reference User')
hax.legend(fontsize=8)

if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
tax.set_title('Manual Test User', loc='left')
lax.set_title('LAtools Test User', loc='left')

Expand Down Expand Up @@ -232,15 +232,15 @@ def residual_plots(df, rep_stats=None, els=['Mg', 'Sr', 'Ba', 'Al', 'Mn']):
if rep_stats is not None:
ax.axhspan(-rep_stats[e][0] * 2, rep_stats[e][0] * 2, color=(0,0,0,0.2), zorder=-1)

if not ax.is_first_col():
if not ax.get_subplotspec().is_first_col():
ax.set_yticklabels([])

if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
hax.set_xlabel('Density')
tax.set_xlabel('Reference User')
lax.set_xlabel('Reference User')

if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
tax.set_title('Manual Test User', loc='left')
lax.set_title('LAtools Test User', loc='left')

Expand Down Expand Up @@ -374,21 +374,21 @@ def bland_altman_plots(df, rep_stats=None, els=['Mg', 'Sr', 'Ba', 'Al', 'Mn']):
for ax in axs[i]:
ax.set_ylim(ylim)

if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.set_ylabel(e + ' ('+ u + ')\nResidual')
else:
ax.set_ylabel('')
ax.set_yticklabels([])

if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
tax.set_xlabel('Mean')
lax.set_xlabel('Mean')
hax.set_xlabel('Residual Density')
hax.legend()
else:
ax.set_xlabel('')

if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
tax.set_title('Manual Test User', loc='left')
lax.set_title('LAtools Test User', loc='left')
hax.set_title('Residuals', loc='left')
Expand Down
10 changes: 5 additions & 5 deletions Supplement/comparison_tools/plots_1sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def comparison_plots(df, els=['Mg', 'Sr', 'Al', 'Mn', 'Fe', 'Cu', 'Zn', 'B']):
lax.plot(xlim, xlim, c='k', ls='dashed', alpha=0.6)

for ax in axs[i]:
if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
hax.set_xlabel('Residual')
lax.set_xlabel('Iolite User')
hax.legend(fontsize=8)

if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
lax.set_title('LAtools', loc='left')

fig.tight_layout()
Expand Down Expand Up @@ -164,14 +164,14 @@ def residual_plots(df, rep_stats=None, els=['Mg', 'Sr', 'Al', 'Mn', 'Fe', 'Cu',
if rep_stats is not None:
ax.axhspan(-rep_stats[e][0] * 2, rep_stats[e][0] * 2, color=(0,0,0,0.2), zorder=-1)

if not ax.is_first_col():
if not ax.get_subplotspec().is_first_col():
ax.set_yticklabels([])

if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
hax.set_xlabel('Density')
lax.set_xlabel('Iolite User')

if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
lax.set_title('LAtools', loc='left')

fig.tight_layout()
Expand Down
Binary file added dist/latools-0.3.20-py3-none-any.whl
Binary file not shown.
Binary file added dist/latools-0.3.20.tar.gz
Binary file not shown.
16 changes: 8 additions & 8 deletions latools/D_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1550,13 +1550,13 @@ def crossplot(self, analytes=None, bins=25, lognorm=True, filt=True, colourful=T
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)

if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.yaxis.set_ticks_position('left')
if ax.is_last_col():
if ax.get_subplotspec().is_last_col():
ax.yaxis.set_ticks_position('right')
if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
ax.xaxis.set_ticks_position('top')
if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
ax.xaxis.set_ticks_position('bottom')

# set up colour scales
Expand Down Expand Up @@ -1664,13 +1664,13 @@ def crossplot_filters(self, filter_string, analytes=None):
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)

if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.yaxis.set_ticks_position('left')
if ax.is_last_col():
if ax.get_subplotspec().is_last_col():
ax.yaxis.set_ticks_position('right')
if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
ax.xaxis.set_ticks_position('top')
if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
ax.xaxis.set_ticks_position('bottom')

# isolate nominal_values for all analytes
Expand Down
16 changes: 8 additions & 8 deletions latools/helpers/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,13 @@ def crossplot(dat, keys=None, lognorm=True, bins=25, figsize=(12, 12),
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)

if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.yaxis.set_ticks_position('left')
if ax.is_last_col():
if ax.get_subplotspec().is_last_col():
ax.yaxis.set_ticks_position('right')
if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
ax.xaxis.set_ticks_position('top')
if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
ax.xaxis.set_ticks_position('bottom')

# set up colour scales
Expand Down Expand Up @@ -473,7 +473,7 @@ def histograms(dat, keys=None, bins=25, logy=False, cmap=None, ncol=4):

ax.set_ylim(1, ax.get_ylim()[1])

if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.set_ylabel(ylab)

ax.set_yticklabels([])
Expand Down Expand Up @@ -701,11 +701,11 @@ def autorange_plot(t, sig, gwin=7, swin=None, win=30,
ax.text(.95, .95, '{} (off)'.format(n), ha='right',
va='top', transform=ax.transAxes)

if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
ax.set_xlabel('Time (s)')
if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.set_ylabel('Gradient (x)')
if ax.is_last_col():
if ax.get_subplotspec().is_last_col():
tax.set_ylabel('Signal (line)')

if fail:
Expand Down
10 changes: 5 additions & 5 deletions latools/latools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ def gradient_histogram(self, analytes=None, win=15, filt=False, bins=None, sampl
ax.axvline(0, ls='dashed', lw=1, c=(0,0,0,0.7))

ax.set_title(a, loc='left')
if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.set_ylabel('N')
ax.set_xlabel(u + '/s')

Expand Down Expand Up @@ -3442,13 +3442,13 @@ def crossplot_filters(self, filter_string, analytes=None,
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)

if ax.is_first_col():
if ax.get_subplotspec().is_first_col():
ax.yaxis.set_ticks_position('left')
if ax.is_last_col():
if ax.get_subplotspec().is_last_col():
ax.yaxis.set_ticks_position('right')
if ax.is_first_row():
if ax.get_subplotspec().is_first_row():
ax.xaxis.set_ticks_position('top')
if ax.is_last_row():
if ax.get_subplotspec().is_last_row():
ax.xaxis.set_ticks_position('bottom')

cmlist = ['Blues', 'BuGn', 'BuPu', 'GnBu',
Expand Down

0 comments on commit 4329658

Please sign in to comment.