Skip to content

Commit

Permalink
debug tests after removing cython
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMatt committed Nov 1, 2023
1 parent eea9239 commit c8e0f1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions harmonic/chains.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np
import copy
import logs as lg
from typing import List

from harmonic import logs as lg

class Chains:
"""
Expand Down Expand Up @@ -116,7 +115,7 @@ def add_chains_2d(
"Length of sample and ln_posterior arrays do not " + "match"
)

i_chain, samples_per_chain = samples.shape[0] // nchains_in
samples_per_chain = samples.shape[0] // nchains_in
for i_chain in range(nchains_in):
self.add_chain(
samples[
Expand Down Expand Up @@ -388,7 +387,6 @@ def remove_burnin(self, nburn: int = 100):
ln_posterior_new = np.empty((0))

i_sample = 0
i_chain, nsamples_chain
for i_chain in range(self.nchains):
start = self.start_indices[i_chain]
end = self.start_indices[i_chain + 1]
Expand Down
8 changes: 3 additions & 5 deletions harmonic/evidence.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import numpy as np
import chains as ch
from math import fsum
import warnings
from enum import Enum
import scipy.special as sp
import cloudpickle
import logs as lg
from harmonic import logs as lg


class Shifting(Enum):
Expand Down Expand Up @@ -63,8 +61,8 @@ def __init__(self, nchains: int, model, shift=Shifting.MEAN_SHIFT):
raise ValueError("Model not fitted.")

self.running_sum = np.zeros(nchains)
self.nsamples_per_chain = np.zeros((nchains), dtype=long)
self.nsamples_eff_per_chain = np.zeros((nchains), dtype=long)
self.nsamples_per_chain = np.zeros(nchains)
self.nsamples_eff_per_chain = np.zeros(nchains)

# Chain parameters and realspace statistics
self.nchains = nchains
Expand Down

0 comments on commit c8e0f1c

Please sign in to comment.