Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
OuyangWenyu committed Feb 14, 2024
2 parents 2cfeafb + e199c68 commit ed26a08
Show file tree
Hide file tree
Showing 11 changed files with 497 additions and 214 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

name: build
jobs:
Expand All @@ -17,9 +19,6 @@ jobs:
config:
- { os: windows-latest, py: "3.10" }
- { os: macOS-latest, py: "3.10" }
- { os: ubuntu-latest, py: "3.7" }
- { os: ubuntu-latest, py: "3.8" }
- { os: ubuntu-latest, py: "3.9" }
- { os: ubuntu-latest, py: "3.10" }

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 4 additions & 2 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ dependencies:
- pandas
- matplotlib
- seaborn
# for gis plotting
- cartopy
- tqdm
- black
- hydroerr
- async-retriever
- rich
# for s3 access
- boto3
- boto3=1.28.64
- minio
- s3fs=2022.05
- s3fs=2023.10
# for dev
- pip
- bump2version
Expand Down
2 changes: 1 addition & 1 deletion hydroutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

__author__ = """Wenyu Ouyang"""
__email__ = '[email protected]'
__version__ = '0.0.4'
__version__ = '0.0.7'

from .hydro_log import *
12 changes: 12 additions & 0 deletions hydroutils/hydro_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ def unserialize_json(my_file):
return my_object


class NumpyArrayEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarray):
return obj.tolist()
return json.JSONEncoder.default(self, obj)


def serialize_json_np(my_dict, my_file):
with open(my_file, "w") as FP:
json.dump(my_dict, FP, cls=NumpyArrayEncoder)


def serialize_pickle(my_object, my_file):
with open(my_file, "wb") as f:
pickle.dump(my_object, f)
Expand Down
Loading

0 comments on commit ed26a08

Please sign in to comment.