Skip to content

Commit

Permalink
Intermediate commit:
Browse files Browse the repository at this point in the history
python api: initialize iorb as None in fit function (-1 is rather dirty)
  • Loading branch information
lcrippa committed Oct 12, 2024
1 parent fdb53cd commit 77bc67b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/func_bath_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os,sys
import types

def chi2_fitgf(self,*args,ispin=0,iorb=-1,fmpi=True):
def chi2_fitgf(self,*args,ispin=0,iorb=None,fmpi=True):
#single normal
chi2_fitgf_single_normal_n3 = self.library.chi2_fitgf_single_normal_n3
chi2_fitgf_single_normal_n3.argtypes = [np.ctypeslib.ndpointer(dtype=complex,ndim=3, flags='F_CONTIGUOUS'),
Expand Down Expand Up @@ -108,7 +108,10 @@ def chi2_fitgf(self,*args,ispin=0,iorb=-1,fmpi=True):

#main function
ispin = ispin + 1
iorb = iorb + 1
if iorb is None:
iorb = 0
else:
iorb = iorb + 1
if len(args) == 2: #normal
g = np.asarray(args[0],order="F")
bath = np.asarray(args[1],order="F")
Expand Down

0 comments on commit 77bc67b

Please sign in to comment.