Sergio Pascual avatar Sergio Pascual committed af4759d

Added __str__ method

Comments (0)

Files changed (1)

         '''The constructor takes two parameters:
 
         :param matter: mater density [adimensional]
-        :param:vacuum: vacuum energy density [adimensional]
+        :param vacuum: vacuum energy density [adimensional]
 
         '''
         self.thisptr = new flrw_nat(matter, vacuum)
         def __get__(self): return self.thisptr.get_vacuum()
         def __set__(self, m): self.thisptr.set_vacuum(m)
 
+    def __str__(self):
+        return 'milia.FlrwNat(matter=%f, vacuum=%f)' % (self.matter, self.vacuum)
+
 cdef class Flrw:
     '''The Friedmann-Lemaitre-Robertson-Walker metric
 
 
         :param hubble: Hubble parameter in km / s / Mpc
         :param matter: mater density (adimensional)
-        :param:vacuum: vacuum energy density (adimensional)
+        :param vacuum: vacuum energy density (adimensional)
 
         '''
 
         '''
         return self.thisptr.hubble_radius()
 
+    def __str__(self):
+        return 'milia.Flrw(hubble=%f, matter=%f, vacuum=%f)' % (self.hubble, self.matter, self.vacuum)
+
     property matter:
         def __get__(self): return (<flrw_nat *>(self.thisptr)).get_matter()
         def __set__(self, m): (<flrw_nat *>(self.thisptr)).set_matter(m)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.