Skip to content

Commit

Permalink
default to v20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Feb 12, 2024
1 parent afd3768 commit 5cb52da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions forcingprocessor/src/forcingprocessor/weights_parq2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import pyarrow.compute as pc
import pyarrow.dataset

def get_weight_json(catchments,jproc):
def get_weight_json(catchments,jproc,version=None):
if version is None: version = "v20.1"


weight_data = {}
ncatch = len(catchments)
Expand Down Expand Up @@ -38,12 +40,10 @@ def get_weight_json(catchments,jproc):
parser.add_argument('--gpkg', dest="geopackage", type=str, help="Path to geopackage file",default = None)
parser.add_argument('--outname', dest="weights_filename", type=str, help="Filename for the weight file")
parser.add_argument('--version', dest="version", type=str, help="Hydrofabric version e.g. \"v21\"")
args = parser.parse_args()
args = parser.parse_args()

global version
version = args.version

weight_versions = ["v20.1"]
weight_versions = ["v20.1",None]
if version not in weight_versions:
raise Exception(f'version must one of: {weight_versions}')

Expand All @@ -57,7 +57,7 @@ def get_weight_json(catchments,jproc):
import geopandas as gpd
gpd.options.io_engine = "pyogrio"
catchments = gpd.read_file(args.geopackage, layer='divides')
catchment_list = sorted(list(catchments['divide_id']))
catchment_list = sorted(list(catchments['divide_id']))

nprocs = os.cpu_count() - 2
catchment_list_list = []
Expand Down

0 comments on commit 5cb52da

Please sign in to comment.