PeTar is a high-performance N-body code for modelling the evolution of star clusters and tidal streams, including the effect of galactic potential, dynamics of binary and hierarchical system, single and binary stellar evolution.
I have encountered a bug using the binary object petar.Binary(), specifically when using the function .generateBinaryID() . The following is my code snippet:
in
4 prim.loadtxt(os.path.join(dataDir, 'data.0.binary'))
5 bid = functions.CantorPair(prim.p1.id, prim.p2.id)
----> 6 prim.addNewMember(key='bid', member=bid )
~/petar/include/petar/base.py in addNewMember(self, key, member)
437 self.ncols += dimension
438 diff_ncols += dimension
--> 439 self.updateHostNcols(diff_ncols)
440
441 def getherDataToArray(self, origin_format=True):
~/petar/include/petar/base.py in updateHostNcols(self, _diff_ncols)
740
741 def updateHostNcols(self, _diff_ncols):
--> 742 if (self.host!=None):
743 if (issubclass(type(self.host), DictNpArrayMix)):
744 self.host.ncols += _diff_ncols
AttributeError: 'Binary' object has no attribute 'host'
"""
I have checked the binary object and can confirm that even when the binary is initialized it has no attribute named host, on the other hand, the particle object does have a host attribute.
Hi Long,
I have encountered a bug using the binary object
petar.Binary()
, specifically when using the function.generateBinaryID()
. The following is my code snippet:Whilst the files load fine, the last call to the function
prim.generateBinaryID()
raises the following error""" AttributeError Traceback (most recent call last)