Skip to content

Commit 397604a

Browse files
Merge pull request #38 from martinkilbinger/prep_0.0.7
Prep 0.0.7
2 parents 8b06994 + bf5f6d7 commit 397604a

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

cs_util/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323

2424
from warnings import warn
2525

26-
__version__ = "0.0.6"
26+
__version__ = "0.0.7"

cs_util/plots.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def savefig(fname, close_fig=True):
5353

5454

5555
def dx(idx, nx=3, fx=1.025, log=True):
56-
"""Dx Plot.
56+
"""Dx.
57+
5758
Return small shift useful to diplace points along the the x-axis
5859
for a more readable plot.
5960
@@ -74,6 +75,7 @@ def dx(idx, nx=3, fx=1.025, log=True):
7475
else:
7576
return fx * (idx - (nx - 1) / 2)
7677

78+
7779
def plot_histograms(
7880
xs,
7981
labels,
@@ -261,15 +263,18 @@ def plot_data_1d(
261263
if linewidths is None:
262264
linewidths = [2] * len(x)
263265
if markers is None:
264-
markers = ['o'] * len(x)
266+
markers = ["o"] * len(x)
265267

266268
if create_figure:
267269
figure(figsize=(10, 10))
268270

269271
for idx in range(len(x)):
270272
this_x = x[idx]
271273
if shift_x:
272-
this_x *= dx(idx, len(x), log=xlog)
274+
if xlog:
275+
this_x *= dx(idx, len(x), log=xlog)
276+
else:
277+
raise ValueError("shift_x without log not implemented yet")
273278
if np.isnan(yerr[idx]).all():
274279
eb = plt.plot(
275280
this_x,
@@ -292,7 +297,7 @@ def plot_data_1d(
292297
)
293298
eb[-1][0].set_linestyle(eb_linestyles[idx])
294299

295-
plt.axhline(color="k", linestyle="dashed", linewidth=linewidths[0]/2)
300+
plt.axhline(color="k", linestyle="dashed", linewidth=linewidths[0] / 2)
296301

297302
if xlog:
298303
plt.xscale("log")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = [
2727
"astropy>=4.0",
2828
"datetime>=4.7",
2929
"matplotlib>=3.3",
30-
"numpy>=1.19",
30+
"numpy>=1.21",
3131
"vos>=3.3",
3232
]
3333

0 commit comments

Comments
 (0)