mc3 3.2.0__tar.gz → 3.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. {mc3-3.2.0 → mc3-3.2.1}/PKG-INFO +2 -2
  2. {mc3-3.2.0 → mc3-3.2.1}/mc3/__init__.py +1 -1
  3. {mc3-3.2.0 → mc3-3.2.1}/mc3/__main__.py +1 -1
  4. {mc3-3.2.0 → mc3-3.2.1}/mc3/chain.py +1 -1
  5. {mc3-3.2.0 → mc3-3.2.1}/mc3/fit_driver.py +1 -1
  6. {mc3-3.2.0 → mc3-3.2.1}/mc3/mcmc_driver.py +1 -1
  7. {mc3-3.2.0 → mc3-3.2.1}/mc3/plots/__init__.py +1 -1
  8. {mc3-3.2.0 → mc3-3.2.1}/mc3/plots/colors.py +10 -2
  9. {mc3-3.2.0 → mc3-3.2.1}/mc3/plots/plot_functions.py +1 -1
  10. {mc3-3.2.0 → mc3-3.2.1}/mc3/plots/posterior.py +76 -21
  11. {mc3-3.2.0 → mc3-3.2.1}/mc3/sampler_driver.py +1 -1
  12. {mc3-3.2.0 → mc3-3.2.1}/mc3/stats/__init__.py +1 -1
  13. {mc3-3.2.0 → mc3-3.2.1}/mc3/stats/gelman.py +1 -1
  14. {mc3-3.2.0 → mc3-3.2.1}/mc3/stats/prayer.py +1 -1
  15. {mc3-3.2.0 → mc3-3.2.1}/mc3/stats/stats.py +3 -3
  16. {mc3-3.2.0 → mc3-3.2.1}/mc3/stats/time_averaging.py +1 -1
  17. {mc3-3.2.0 → mc3-3.2.1}/mc3/utils/__init__.py +1 -1
  18. {mc3-3.2.0 → mc3-3.2.1}/mc3/utils/log.py +1 -1
  19. {mc3-3.2.0 → mc3-3.2.1}/mc3/utils/utils.py +1 -1
  20. {mc3-3.2.0 → mc3-3.2.1}/mc3/version.py +2 -2
  21. {mc3-3.2.0 → mc3-3.2.1}/mc3.egg-info/PKG-INFO +2 -2
  22. {mc3-3.2.0 → mc3-3.2.1}/setup.py +1 -1
  23. {mc3-3.2.0 → mc3-3.2.1}/src_c/_binarray.c +1 -1
  24. {mc3-3.2.0 → mc3-3.2.1}/src_c/_chisq.c +1 -1
  25. {mc3-3.2.0 → mc3-3.2.1}/src_c/_dwt.c +1 -1
  26. {mc3-3.2.0 → mc3-3.2.1}/src_c/_time_averaging.c +1 -1
  27. {mc3-3.2.0 → mc3-3.2.1}/src_c/include/ind.h +1 -1
  28. {mc3-3.2.0 → mc3-3.2.1}/src_c/include/stats.h +1 -1
  29. {mc3-3.2.0 → mc3-3.2.1}/src_c/include/wavelet.h +1 -1
  30. {mc3-3.2.0 → mc3-3.2.1}/tests/test_fit.py +1 -1
  31. {mc3-3.2.0 → mc3-3.2.1}/tests/test_logging.py +1 -1
  32. {mc3-3.2.0 → mc3-3.2.1}/tests/test_mcmc.py +11 -4
  33. {mc3-3.2.0 → mc3-3.2.1}/tests/test_plots.py +1 -1
  34. {mc3-3.2.0 → mc3-3.2.1}/tests/test_stats.py +1 -1
  35. {mc3-3.2.0 → mc3-3.2.1}/tests/test_utils.py +1 -1
  36. {mc3-3.2.0 → mc3-3.2.1}/.readthedocs.yml +0 -0
  37. {mc3-3.2.0 → mc3-3.2.1}/CONTRIBUTING.md +0 -0
  38. {mc3-3.2.0 → mc3-3.2.1}/LICENSE +0 -0
  39. {mc3-3.2.0 → mc3-3.2.1}/MANIFEST.in +0 -0
  40. {mc3-3.2.0 → mc3-3.2.1}/Makefile +0 -0
  41. {mc3-3.2.0 → mc3-3.2.1}/README.md +0 -0
  42. {mc3-3.2.0 → mc3-3.2.1}/docs/Makefile +0 -0
  43. {mc3-3.2.0 → mc3-3.2.1}/docs/api.rst +0 -0
  44. {mc3-3.2.0 → mc3-3.2.1}/docs/conf.py +0 -0
  45. {mc3-3.2.0 → mc3-3.2.1}/docs/contributing.rst +0 -0
  46. {mc3-3.2.0 → mc3-3.2.1}/docs/figures/quad_bestfit.png +0 -0
  47. {mc3-3.2.0 → mc3-3.2.1}/docs/figures/quad_fitting.png +0 -0
  48. {mc3-3.2.0 → mc3-3.2.1}/docs/figures/quad_hist.png +0 -0
  49. {mc3-3.2.0 → mc3-3.2.1}/docs/figures/quad_pairwise.png +0 -0
  50. {mc3-3.2.0 → mc3-3.2.1}/docs/figures/quad_trace.png +0 -0
  51. {mc3-3.2.0 → mc3-3.2.1}/docs/figures/rms-vs-binsize.png +0 -0
  52. {mc3-3.2.0 → mc3-3.2.1}/docs/fit_tutorial.rst +0 -0
  53. {mc3-3.2.0 → mc3-3.2.1}/docs/get_started.rst +0 -0
  54. {mc3-3.2.0 → mc3-3.2.1}/docs/index.rst +0 -0
  55. {mc3-3.2.0 → mc3-3.2.1}/docs/license.rst +0 -0
  56. {mc3-3.2.0 → mc3-3.2.1}/docs/make.bat +0 -0
  57. {mc3-3.2.0 → mc3-3.2.1}/docs/mcmc_tutorial.rst +0 -0
  58. {mc3-3.2.0 → mc3-3.2.1}/docs/references.rst +0 -0
  59. {mc3-3.2.0 → mc3-3.2.1}/docs/time_averaging.rst +0 -0
  60. {mc3-3.2.0 → mc3-3.2.1}/examples/get_started.py +0 -0
  61. {mc3-3.2.0 → mc3-3.2.1}/examples/timeavg.py +0 -0
  62. {mc3-3.2.0 → mc3-3.2.1}/examples/tutorial.py +0 -0
  63. {mc3-3.2.0 → mc3-3.2.1}/mc3.egg-info/SOURCES.txt +0 -0
  64. {mc3-3.2.0 → mc3-3.2.1}/mc3.egg-info/dependency_links.txt +0 -0
  65. {mc3-3.2.0 → mc3-3.2.1}/mc3.egg-info/entry_points.txt +0 -0
  66. {mc3-3.2.0 → mc3-3.2.1}/mc3.egg-info/requires.txt +0 -0
  67. {mc3-3.2.0 → mc3-3.2.1}/mc3.egg-info/top_level.txt +0 -0
  68. {mc3-3.2.0 → mc3-3.2.1}/pyproject.toml +0 -0
  69. {mc3-3.2.0 → mc3-3.2.1}/pytest.ini +0 -0
  70. {mc3-3.2.0 → mc3-3.2.1}/requirements.txt +0 -0
  71. {mc3-3.2.0 → mc3-3.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: mc3
3
- Version: 3.2.0
3
+ Version: 3.2.1
4
4
  Summary: Multi-core Markov-chain Monte Carlo package
5
5
  Author-email: Patricio Cubillos <patricio.cubillos@oeaw.ac.at>
6
6
  License: Copyright (c) 2015-2022 Patricio Cubillos and contributors.
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  from .sampler_driver import *
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import sys
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import sys
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  from .plot_functions import *
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -105,6 +105,7 @@ def rainbow_text(ax, texts, fontsize, colors=None, loc='above'):
105
105
  fig = ax.get_figure()
106
106
  t = ax.transAxes
107
107
  x = 0.02
108
+ horizontalalignment = 'left'
108
109
  if loc == 'above':
109
110
  y = 1.02
110
111
  verticalalignment = 'bottom'
@@ -113,11 +114,18 @@ def rainbow_text(ax, texts, fontsize, colors=None, loc='above'):
113
114
  y = 0.97
114
115
  verticalalignment = 'top'
115
116
  bbox = {'facecolor':'white', 'alpha':0.5, 'pad':0.0, 'edgecolor':'none'}
117
+ elif loc == 'under':
118
+ y = -0.04
119
+ x = 0.97
120
+ verticalalignment = 'top'
121
+ horizontalalignment = 'right'
122
+ bbox = None
123
+
116
124
  printed_texts = []
117
125
  for string, col in zip(texts, colors):
118
126
  text = ax.text(
119
127
  x, y, string, color=col, transform=t,
120
- ha='left', va=verticalalignment,
128
+ ha=horizontalalignment, va=verticalalignment,
121
129
  size=fontsize,
122
130
  bbox=bbox,
123
131
  )
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -193,6 +193,7 @@ def _pairwise(
193
193
  hist, hist_xran, axes, ranges, estimates,
194
194
  palette, nlevels, absolute_dens, lmax,
195
195
  linewidth, theme, alpha=0.8, clear=True,
196
+ swap_axes=False,
196
197
  ):
197
198
  """
198
199
  Lowest-lever routine to plot pair-wise posterior distributions.
@@ -206,13 +207,19 @@ def _pairwise(
206
207
  for icol in range(npars-1):
207
208
  for irow in range(icol, npars-1):
208
209
  ax = axes[irow,icol]
210
+ if swap_axes:
211
+ row, col = icol, irow+1
212
+ histo = hist[col-1,row].T
213
+ else:
214
+ row, col = irow+1, icol
215
+ histo = hist[row-1,col]
209
216
  if clear:
210
217
  ax.clear()
211
218
  extent = (
212
- hist_xran[icol,0],
213
- hist_xran[icol,-1],
214
- hist_xran[irow+1,0],
215
- hist_xran[irow+1,-1],
219
+ hist_xran[col, 0],
220
+ hist_xran[col, -1],
221
+ hist_xran[row, 0],
222
+ hist_xran[row, -1],
216
223
  )
217
224
  levels = np.zeros(nlevels+1)
218
225
  levels[1:] = np.linspace(1.0, lmax[irow,icol], nlevels)
@@ -220,29 +227,30 @@ def _pairwise(
220
227
  colors[0,3] = 0.0
221
228
  colors[1,3] = 0.75*alpha
222
229
  cont = ax.contourf(
223
- hist[irow,icol],
230
+ histo,
224
231
  colors=colors, levels=levels,
225
232
  origin='lower', extent=extent,
226
233
  )
227
- edge_color = to_rgba(theme.color, alpha=0.65)
228
- for c in cont.collections:
229
- c.set_edgecolor(edge_color)
230
- c.set_linewidth(0.1)
231
- cont.collections[0].set_edgecolor((1,1,1,0))
232
- if estimates[icol] is not None:
234
+ edge_color = to_rgba(theme.color, alpha=0.25)
235
+ edge_colors = [edge_color for _ in cont.get_paths()]
236
+ edge_colors[0] = (1,1,1,0)
237
+ cont.set_edgecolor(edge_colors)
238
+ cont.set_linewidth(0.1)
239
+
240
+ if estimates[col] is not None:
233
241
  ax.axvline(
234
- estimates[icol],
242
+ estimates[col],
235
243
  dashes=(9,2), lw=linewidth, color=theme.dark_color,
236
244
  )
237
- if estimates[irow+1] is not None:
245
+ if estimates[row] is not None:
238
246
  ax.axhline(
239
- estimates[irow+1],
247
+ estimates[row],
240
248
  dashes=(9,2), lw=linewidth, color=theme.dark_color,
241
249
  )
242
- if ranges[icol] is not None:
243
- ax.set_xlim(ranges[icol])
244
- if ranges[irow] is not None:
245
- ax.set_ylim(ranges[irow+1])
250
+ if ranges[col] is not None:
251
+ ax.set_xlim(ranges[col])
252
+ if ranges[row] is not None:
253
+ ax.set_ylim(ranges[row])
246
254
 
247
255
 
248
256
  def _plot_marginal(obj):
@@ -302,7 +310,11 @@ def _plot_pairwise(obj):
302
310
  for icol in range(npars-1):
303
311
  for irow in range(icol, npars-1):
304
312
  ax = obj.pair_axes[irow,icol]
305
- h = nx*irow + icol + 1 + npars*int(obj.plot_marginal)
313
+ if obj.orientation == 'vertical':
314
+ h = nx*irow + icol + 1 + npars*int(obj.plot_marginal)
315
+ else:
316
+ h = 2 + (nx+int(obj.plot_marginal))*icol + irow - icol
317
+
306
318
  ax_position = subplot(
307
319
  obj.rect, obj.margin, h, nx, nx, obj.ymargin, dry=True,
308
320
  )
@@ -495,7 +507,7 @@ class RangeUpdate(SoftUpdate):
495
507
  setattr(obj.source, var_name, value)
496
508
 
497
509
 
498
- class Marginal(object):
510
+ class Marginal():
499
511
  """A mostly-interactive marginal posterior plotting object."""
500
512
  # Soft-update properties:
501
513
  pnames = SoftUpdate()
@@ -625,6 +637,48 @@ class Marginal(object):
625
637
  if savefile is not None:
626
638
  self.fig.savefig(savefile, dpi=300)
627
639
 
640
+ def overplot(self, post, labels=None, nlevels=4, alpha=0.4):
641
+ """
642
+ Overplot additional posteriors in the same figure.
643
+
644
+ This method is still work in progress!
645
+ Note that a call to self.update() or even soft updates
646
+ will remove all/some of the overplot data. In such case
647
+ the user would need to make a new call to self.overplot().
648
+ It is also recommended to set show_estimates=False to
649
+ prevent over-crowding the figures.
650
+
651
+ Parameters
652
+ ----------
653
+ posts: 1D iterable of Posterior objects
654
+ Currently there are no checks that these new posteriors
655
+ have the same parameters (nor same statistics) as self.
656
+ The user needs to make sure they are all compartible.
657
+ labels: 1D iterable of strings
658
+ Labels for each posterior. Note that if provided, the
659
+ length of labels has to be one more than posts, because
660
+ it also contains the label for self.
661
+ """
662
+ if '_like' in post.statistics:
663
+ hpd_min = post.hpd_min
664
+ else:
665
+ hpd_min = None
666
+
667
+ estimates = post.estimates
668
+ if not self.show_estimates:
669
+ estimates = [None for _ in estimates]
670
+
671
+ _histogram(
672
+ post.posterior, estimates, post.ranges,
673
+ self.hist_axes, self.bins,
674
+ post.pdf, post.xpdf,
675
+ hpd_min, post.low_bounds, post.high_bounds,
676
+ self.linewidth, post.theme,
677
+ post.orientation,
678
+ top_pad=1.25,
679
+ clear=False,
680
+ )
681
+
628
682
 
629
683
  class Figure(Marginal):
630
684
  """A mostly-interactive pair-wise posterior plotting object."""
@@ -756,6 +810,7 @@ class Figure(Marginal):
756
810
  self.lmax,
757
811
  self.linewidth,
758
812
  self.theme,
813
+ swap_axes=self.orientation=='upper right',
759
814
  )
760
815
 
761
816
  # The colorbar:
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  from .gelman import *
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -611,7 +611,7 @@ def dwt_daub4(array, inverse=False):
611
611
  return dwt.daub4(np.array(array), isign)
612
612
 
613
613
 
614
- class Loglike(object):
614
+ class Loglike():
615
615
  """
616
616
  Wrapper to compute log(likelihood)
617
617
 
@@ -1041,7 +1041,7 @@ def summary_stats(post, mc3_output=None, filename=None):
1041
1041
 
1042
1042
  # Central quantile:
1043
1043
  f.write(
1044
- '\nCentral quintile credible intervals:\n'
1044
+ '\nCentral quantile credible intervals:\n'
1045
1045
  ' 2sigma_low 1sigma_low 1sigma_up 2sigma_up '
1046
1046
  'Parameter\n'
1047
1047
  )
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  from .utils import *
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  __all__ = [
@@ -1,9 +1,9 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  # mc3 Version:
5
5
  MC3_VER = 3 # Major version
6
6
  MC3_MIN = 2 # Minor version
7
- MC3_REV = 0 # Revision
7
+ MC3_REV = 1 # Revision
8
8
 
9
9
  __version__ = f'{MC3_VER}.{MC3_MIN}.{MC3_REV}'
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: mc3
3
- Version: 3.2.0
3
+ Version: 3.2.1
4
4
  Summary: Multi-core Markov-chain Monte Carlo package
5
5
  Author-email: Patricio Cubillos <patricio.cubillos@oeaw.ac.at>
6
6
  License: Copyright (c) 2015-2022 Patricio Cubillos and contributors.
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import os
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  #include <Python.h>
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  #include <Python.h>
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  #include <Python.h>
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  #include <Python.h>
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  /* Definitions for indexing Numpy arrays: */
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  /******************************************************************
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ // Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  // mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  /**********************************************************************
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # MC3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import pytest
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # MC3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import pytest
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # mc3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import os
@@ -233,14 +233,17 @@ def test_mcmc_gr_break_iterations(capsys):
233
233
  def test_mcmc_thin_gr_break_frac(capsys):
234
234
  nsamples = 1e4
235
235
  thin = 5
236
+ nchains = 3
236
237
  output = mc3.sample(
237
238
  data, uncert, func=quad, params=np.copy(params),
238
239
  sampler=sampler, indparams=[x],
239
240
  pstep=pstep, nsamples=nsamples, burnin=100, thinning=thin,
240
- grtest=True, grbreak=1.1, grnmin=0.55)
241
+ nchains=nchains, grtest=True, grbreak=1.1, grnmin=0.55)
241
242
  captured = capsys.readouterr()
242
243
  assert output is not None
243
- assert output['chisq'].size < nsamples/thin * 0.7
244
+ size = output['chisq'].size
245
+ expected_size = nsamples/thin * 0.9
246
+ assert size < expected_size
244
247
  assert "All parameters satisfy the GR convergence threshold of 1.1" \
245
248
  in captured.out
246
249
 
@@ -248,14 +251,18 @@ def test_mcmc_thin_gr_break_frac(capsys):
248
251
  def test_mcmc_gr_thin_break_iterations(capsys):
249
252
  nsamples = 1e4
250
253
  thin = 5
254
+ nchains = 3
251
255
  output = mc3.sample(
252
256
  data, uncert, func=quad, params=np.copy(params),
253
257
  sampler=sampler, indparams=[x],
254
258
  pstep=pstep, nsamples=nsamples, burnin=100, thinning=thin,
259
+ nchains=nchains,
255
260
  grtest=True, grbreak=1.1, grnmin=5000)
256
261
  captured = capsys.readouterr()
257
262
  assert output is not None
258
- assert output['chisq'].size < nsamples/thin * 0.7
263
+ size = output['chisq'].size
264
+ expected_size = nsamples/thin * 0.9
265
+ assert size < expected_size
259
266
  assert "All parameters satisfy the GR convergence threshold of 1.1" \
260
267
  in captured.out
261
268
 
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # MC3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import pytest
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # MC3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import pytest
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2023 Patricio Cubillos and contributors.
1
+ # Copyright (c) 2015-2025 Patricio Cubillos and contributors.
2
2
  # MC3 is open-source software under the MIT license (see LICENSE).
3
3
 
4
4
  import pytest
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes