Skip to content

Commit

Permalink
use raven_hydro.__raven_version__
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 25, 2025
1 parent 8c77373 commit 018a763
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/ravenpy/config/defaults.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from raven_hydro import __raven_version__

units = {
"PRECIP": "mm/d",
"PRECIP_DAILY_AVE": "mm/d",
Expand Down Expand Up @@ -58,8 +60,7 @@ def default_nc_attrs():
import datetime as dt

now = dt.datetime.now().isoformat(timespec="seconds")
# TODO: get version from shared library
version = "3.7"
version = __raven_version__

return {
"history": f"Created on {now} by Raven {version}",
Expand Down
7 changes: 3 additions & 4 deletions src/ravenpy/config/rvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from typing import Any, Optional, Union

import cftime
from pydantic import ConfigDict, Field, ValidationInfo, field_validator, model_validator
from pydantic import ConfigDict, Field, ValidationInfo, field_validator
from raven_hydro import __raven_version__

from ..config import commands as rc
from ..config import options as o
Expand Down Expand Up @@ -262,13 +263,11 @@ class Config(RVI, RVC, RVH, RVT, RVP, RVE):

def header(self, rv):
"""Return the header to print at the top of each RV file."""
import datetime as dt
from textwrap import dedent

import ravenpy

# TODO: Better mechanism to fetch version
version = "3.7"
version = __raven_version__

return dedent(
f"""
Expand Down

0 comments on commit 018a763

Please sign in to comment.