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
Logger.add(instance, quantities=['some_non_default_quantity']) does not add the quantity as documented:
This is what the documentation states:
The only_default flag is mainly a convenience by allowing quantities not commonly logged (but available) to be passed over unless explicitly asked for. You can override the only_default flag by explicitly listing the quantities you want in add ...
Script
# Include a minimal script that reproduces the problemimporthoomdcell=hoomd.md.nlist.Cell(buffer=0.4)
logger=hoomd.logging.Logger(categories=['scalar'])
logger.add(cell, quantities=['num_builds'])
print("logger items:")
forkey,valueinlogger.items():
print(key,value)
logger2=hoomd.logging.Logger(categories=['scalar'], only_default=False)
logger2.add(cell, quantities=['num_builds'])
print("logger2 items:")
forkey,valueinlogger2.items():
print(key,value)
Output
logger items:
logger2 items:
('md', 'nlist', 'Cell', 'num_builds') <hoomd.logging._LoggerEntry object at 0x7fa45fbea740>
('md', 'nlist', 'Cell') {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbea7a0>}
('md', 'nlist') {'Cell': {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbea8f0>}}
('md',) {'nlist': {'Cell': {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbeace0>}}}
Expected output
logger items:
('md', 'nlist', 'Cell', 'num_builds') <hoomd.logging._LoggerEntry object at 0x7fa45fbea740>
('md', 'nlist', 'Cell') {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbea7a0>}
('md', 'nlist') {'Cell': {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbea8f0>}}
('md',) {'nlist': {'Cell': {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbeace0>}}}
logger2 items:
('md', 'nlist', 'Cell', 'num_builds') <hoomd.logging._LoggerEntry object at 0x7fa45fbea740>
('md', 'nlist', 'Cell') {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbea7a0>}
('md', 'nlist') {'Cell': {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbea8f0>}}
('md',) {'nlist': {'Cell': {'num_builds': <hoomd.logging._LoggerEntry object at 0x7fa45fbeace0>}}}
Description
Logger.add(instance, quantities=['some_non_default_quantity'])
does not add the quantity as documented:This is what the documentation states:
Script
Output
Expected output
Configuration
Platform:
Installation method:
Versions:
trunk-minor
Developer
@b-butler can you look into this?
The text was updated successfully, but these errors were encountered: