DOI-USGS / DOI-USGS/pywatershed
bools as ints
- Dominant language
- Fortran
- Stars
- 54
- Forks
- 25
- Avg merge
- 14h 56m
- Merged PRs (30d)
- 10
Description
These variables are really booleans but we are treating them as ints to be consistent with PRMS. This is happening in a translation step in meta.py that I'm removing, so I'm changing the types to int in the metadata/variables.yaml. These should eventually be changed to boolean in the metadata and handled as such. this list may not be comprehensive.
```
diff --git a/pynhm/static/metadata/variables.yaml b/pynhm/static/metadata/variables.yaml
index 17e075c..fdd19b3 100644
--- a/pynhm/static/metadata/variables.yaml
+++ b/pynhm/static/metadata/variables.yaml
@@ -1636,7 +1636,7 @@ iasw:
on curve and maximum (1) or is on the defined curve (0)
dimensions:
0: nhru
- type: bool
+ type: int32
units: none
imperv_evap:
desc: Evaporation from impervious area for each HRU
@@ -1896,7 +1896,7 @@ lst:
the albedo curve (1) (albset_snm or albset_sna) otherwise (0)
dimensions:
0: nhru
- type: bool
+ type: int32
units: none
lwrad_net:
desc: Net long-wave radiation for each HRU
@@ -2109,7 +2109,7 @@ pptmix_nopack:
present on an HRU (1), otherwise (0)
dimensions:
0: nhru
- type: bool
+ type: int32
units: none
precip:
desc: Precipitation at each measurement station
```
Contributor guide
Research direction
Start with pynhm/static/metadata/variables.yaml and the translation step in meta.py. Review the listed boolean-like variables and search for other variables handled as integer types. Done means the relevant metadata uses boolean types and the translation path handles them consistently, but the issue notes that the list may not be comprehensive.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100