You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Database.__str__ prints the number of columns instead of rows for snapshot count #295
Describe the bug
When printing a Database object, the __str__ method incorrectly reports the number of degrees of freedom (columns) as the number of snapshots. This occurs because the string formatting calls self.snapshots_matrix.shape[1] instead of shape[0] or len(self).
To Reproduce
importnumpyasnpfromezyrbimportDatabase# Create a database with 3 snapshots and 100 degrees of freedomparams=np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
snapshots=np.random.rand(3, 100)
db=Database(params, snapshots)
print(db)
Expected behavior
len(db): 3
db.parameters_matrix.shape: (3, 2)
db.snapshots_matrix.shape: (3, 100)
Output of print(db):
Database with 3 snapshots and 2 parameters
Output
len(db): 3
db.parameters_matrix.shape: (3, 2)
db.snapshots_matrix.shape: (3, 100)
Output of print(db):
Database with 100 snapshots and 2 parameters
Activity