Skip to content

Commit

Permalink
Bug fix for plot methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerdougan committed Jun 23, 2024
1 parent ffdb8c6 commit 810a760
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 199 deletions.
4 changes: 1 addition & 3 deletions docs/_build/_modules/waltlabtools/cal_curve.html
Original file line number Diff line number Diff line change
Expand Up @@ -914,9 +914,7 @@ <h1>Source code for waltlabtools.cal_curve</h1><div class="highlight"><pre>
<span class="n">cols</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="o">.</span><span class="n">get_level_values</span><span class="p">(</span><span class="n">levels</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span><span class="o">.</span><span class="n">unique</span><span class="p">()</span>
<span class="n">ncols</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="o">.</span><span class="n">get_level_values</span><span class="p">(</span><span class="n">levels</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span><span class="o">.</span><span class="n">nunique</span><span class="p">()</span>
<span class="n">nrows</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="o">.</span><span class="n">get_level_values</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">value_counts</span><span class="p">()</span><span class="o">.</span><span class="n">max</span><span class="p">()</span>
<span class="n">fig</span><span class="p">,</span> <span class="n">axs</span> <span class="o">=</span> <span class="n">subplots</span><span class="p">(</span>
<span class="n">nrows</span><span class="o">=</span><span class="n">nrows</span><span class="p">,</span> <span class="n">ncols</span><span class="o">=</span><span class="n">ncols</span><span class="p">,</span> <span class="n">fig</span><span class="o">=</span><span class="n">fig</span><span class="p">,</span> <span class="n">squeeze</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span>
<span class="p">)</span>
<span class="n">fig</span><span class="p">,</span> <span class="n">axs</span> <span class="o">=</span> <span class="n">subplots</span><span class="p">(</span><span class="n">nrows</span><span class="o">=</span><span class="n">nrows</span><span class="p">,</span> <span class="n">ncols</span><span class="o">=</span><span class="n">ncols</span><span class="p">,</span> <span class="n">fig</span><span class="o">=</span><span class="n">fig</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

<span class="n">ax_s</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(),</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">object</span><span class="p">)</span>
<span class="k">for</span> <span class="n">c</span><span class="p">,</span> <span class="n">col</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">cols</span><span class="p">):</span>
Expand Down
4 changes: 2 additions & 2 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% set name = "waltlabtools" %}
{% set version = "1.0.0b26" %}
{% set version = "1.0.0b27" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/waltlabtools-{{ version }}.tar.gz
sha256: d38888eab34192924a264309c258ab0451a55b28f23bb08e35124e9ffd6ffa24
sha256: 192fe2c5c13cf59a254ca6520dab57bd1fc62e0c00dd40d80b5ff759e5e79ba0

build:
noarch: python
Expand Down
147 changes: 0 additions & 147 deletions src/waltlabtools.egg-info/PKG-INFO

This file was deleted.

17 changes: 0 additions & 17 deletions src/waltlabtools.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/waltlabtools.egg-info/dependency_links.txt

This file was deleted.

21 changes: 0 additions & 21 deletions src/waltlabtools.egg-info/requires.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/waltlabtools.egg-info/top_level.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/waltlabtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .model import *
from .read import *

__version__ = "v1.0.0b27"
__version__ = "v1.0.0b28"
10 changes: 7 additions & 3 deletions src/waltlabtools/_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ def get_fig_ax(


def subplots(
nrows: int = 1, ncols: int = 1, fig: Optional[Figure] = None, **kwargs
) -> tuple[Figure, np.ndarray]:
nrows: int = 1,
ncols: int = 1,
fig: Optional[Figure] = None,
squeeze=False,
**kwargs,
) -> tuple[Figure, np.ndarray | Axes]:
figsize = (
ncols * rcParams["figure.figsize"][0],
nrows * rcParams["figure.figsize"][1],
Expand All @@ -48,7 +52,7 @@ def subplots(
axs = fig.subplots(
nrows=nrows,
ncols=ncols,
squeeze=False,
squeeze=squeeze,
**match_kwargs(fig.subplots, kwargs),
)
return fig, axs
Expand Down
4 changes: 1 addition & 3 deletions src/waltlabtools/cal_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,7 @@ def plot( # type: ignore
cols = self.index.get_level_values(levels[0]).unique()
ncols = self.index.get_level_values(levels[0]).nunique()
nrows = self.index.get_level_values(0).value_counts().max()
fig, axs = subplots(
nrows=nrows, ncols=ncols, fig=fig, squeeze=False, **kwargs
)
fig, axs = subplots(nrows=nrows, ncols=ncols, fig=fig, **kwargs)

ax_s = pd.Series(index=self.index.sort_values(), dtype=object)
for c, col in enumerate(cols):
Expand Down

0 comments on commit 810a760

Please sign in to comment.