-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add data format checker for own data
- Loading branch information
1 parent
995a335
commit d18c904
Showing
10 changed files
with
560 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ dependencies: | |
- twine | ||
- bump2version | ||
- muskingumcunge | ||
- hydrodataset | ||
- hydrodata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
PRCP_NAME = "prcp(mm/day)" | ||
PET_NAME = "pet(mm/day)" | ||
ET_NAME = "et(mm/day)" | ||
FLOW_NAME = "flow(m^3/s)" | ||
NODE_FLOW_NAME = "node1_flow(m^3/s)" | ||
AREA_NAME = "area(km^2)" | ||
TIME_NAME = "time" | ||
TIME_FORMAT = "%Y-%m-%d %H:%M:%S" | ||
ID_NAME = "id" | ||
NAME_NAME = "name" | ||
|
||
|
||
def remove_unit_from_name(name_with_unit): | ||
""" | ||
Remove the unit from a variable name. | ||
Parameters | ||
---------- | ||
name_with_unit : str | ||
The name of the variable including its unit, e.g., "prcp(mm/day)". | ||
Returns | ||
------- | ||
str | ||
The name of the variable without the unit, e.g., "prcp". | ||
""" | ||
return name_with_unit.split("(")[0] | ||
|
||
|
||
def get_unit_from_name(name_with_unit): | ||
""" | ||
Extract the unit from a variable name. | ||
Parameters | ||
---------- | ||
name_with_unit : str | ||
The name of the variable including its unit, e.g., "prcp(mm/day)". | ||
Returns | ||
------- | ||
str | ||
The unit of the variable, e.g., "mm/day". | ||
""" | ||
return name_with_unit.split("(")[1].strip(")") if "(" in name_with_unit else "" |
Oops, something went wrong.