Riverscapes / riverscapes-tools

Open-source Python 3.0 tools for the Riverscapes organization
https://tools.riverscapes.net/
GNU General Public License v3.0
11 stars 11 forks source link

RSContext log file Max Stats #981

Open philipbaileynar opened 2 months ago

philipbaileynar commented 2 months ago

This is super minor...

Right at the end of the RSContext log file for Upper Bear, there's the following line in what I think is the logging during the report.

2024-08-08 22:56:38,454 DEBUG    [Debug          ] MaxStats: <rscommons.debug.ProcStats object at 0x76c0b9328890>

I get the sense that someone is converting a complex object to string, rather than extracting the property (presumably "Max Stats") into the log file. Please investigate and fix this log line so that it produces a meaningful log entry and not the memory address of a complex object.

surrounding lines of log:

2024-08-08 22:56:35,774 INFO     [collect_feature_class] Collect complete.
2024-08-08 22:56:35,872 INFO     [add_project_extents] ProjectBounds node added: /workspaces/data/rs_context/1601010101/project_bounds.geojson
2024-08-08 22:56:37,451 INFO     [Report         ] Creating report at /workspaces/data/rs_context/1601010101/rs_context.html
2024-08-08 22:56:37,504 DEBUG    [RSContext Report] Report Writing Completed
2024-08-08 22:56:37,504 INFO     [RS Context     ] Process completed successfully.
2024-08-08 22:56:38,454 DEBUG    [Debug          ] MaxStats: <rscommons.debug.ProcStats object at 0x76c0b9328890>
2024-08-08 22:56:40,076 DEBUG    [RS Context     ] Return code: {'DEM': '/workspaces/data/rs_context/1601010101/topography/dem.tif', 'Slope': '/workspaces/data/rs_context/1601010101/topography/slope.tif', 'ExistingVeg': '/workspaces/data/national_project/landfire/220/LC20_EVT_220.tif', 'HistoricVeg': '/workspaces/data/national_project/landfire/220/LC20_BPS_220.tif', 'NHD': {'WBDHU2': '/workspaces/data/download/scratch/rs_context/nhd/1601/WBDHU2.shp', 'WBDHU4': '/workspaces/data/download/scratch/rs_context/nhd/1601/WBDHU4.shp', 'WBDHU6': '/workspaces/data/download/scratch/rs_context/nhd/1601/WBDHU6.shp', 'WBDHU8': '/workspaces/data/download/scratch/rs_context/nhd/1601/WBDHU8.shp', 'WBDHU10': '/workspaces/data/download/scratch/rs_context/nhd/1601/WBDHU10.shp', 'WBDHU12': '/workspaces/data/download/scratch/rs_context/nhd/1601/WBDHU12.shp', 'NHDFlowline': '/workspaces/data/download/scratch/rs_context/nhd/1601/NHDFlowline.shp', 'NHDArea': '/workspaces/data/download/scratch/rs_context/nhd/1601/NHDArea.shp', 'NHDWaterbody': '/workspaces/data/download/scratch/rs_context/nhd/1601/NHDWaterbody.shp', 'NHDPlusCatchment': '/workspaces/data/download/scratch/rs_context/nhd/1601/NHDPlusCatchment.shp', 'HUC8Extent': '/workspaces/data/download/scratch/rs_context/nhd/1601/max_extent.shp'}}, [Max process usage] datetime: 2024-08-08 22:48:10, cpu_percent: 103, mem_resident: 2156.20Mb, mem_virtual: 3045.33Mb, num_children: 0, mem_children_resident: 2156.20Mb, mem_children_virtual: 3045.33Mb
2024-08-08 22:56:40,474 DEBUG    [safe_remove_dir] Directory removed: /workspaces/data/download/scratch/rs_context

Related to #978

r-k-g commented 2 months ago

Relevant line of code: https://github.com/Riverscapes/riverscapes-tools/blob/5050aa025497c2add0f01b8803f40ac8b3ceeccf/lib/commons/rscommons/debug.py#L171

philipbaileynar commented 2 months ago

Super low priority @MattReimer ... just being thorough. Rowan and I had some ideas about fixing this, but weren't 100% certain on your original intent and so we deferred to you.

MattReimer commented 2 months ago

Intent is everything