From 5a46e7590b24e0ced67c6fe5358e91601e8fed2d Mon Sep 17 00:00:00 2001 From: Gutenson <1517780819121002@mil> Date: Mon, 23 Nov 2020 12:19:39 -0600 Subject: [PATCH 1/3] updated network.py and muskingum.py to allow for the use of 64-bit integers. --- RAPIDpy/gis/muskingum.py | 4 ++-- RAPIDpy/gis/network.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/RAPIDpy/gis/muskingum.py b/RAPIDpy/gis/muskingum.py index 851b106..26fb889 100644 --- a/RAPIDpy/gis/muskingum.py +++ b/RAPIDpy/gis/muskingum.py @@ -116,7 +116,7 @@ def CreateMuskingumKfacFile(in_drainage_line, open_shapefile(in_drainage_line, file_geodatabase) number_of_features = ogr_drainage_line_shapefile_lyr.GetFeatureCount() - river_id_list = np.zeros(number_of_features, dtype=np.int32) + river_id_list = np.zeros(number_of_features, dtype=np.int64) length_list = \ np.zeros(number_of_features, dtype=np.float32) @@ -145,7 +145,7 @@ def CreateMuskingumKfacFile(in_drainage_line, connectivity_table = np.loadtxt(in_connectivity_file, delimiter=",", ndmin=2, - dtype=int) + dtype=np.int64) length_slope_array = [] kfac2_array = [] diff --git a/RAPIDpy/gis/network.py b/RAPIDpy/gis/network.py index d659bac..a7916ba 100644 --- a/RAPIDpy/gis/network.py +++ b/RAPIDpy/gis/network.py @@ -45,7 +45,7 @@ def StreamIDNextDownIDToConnectivity(stream_id_array, np.concatenate( [np.array([hydroid, nextDownID, count_upstream]), list_upstreamID] - ).astype(int)) + ).astype(np.int64)) with open_csv(out_csv_file, 'w') as csvfile: connectwriter = csv_writer(csvfile) @@ -54,7 +54,7 @@ def StreamIDNextDownIDToConnectivity(stream_id_array, row_list, np.array([0 for _ in xrange(max_count_upstream - row_list[2])]) ]) - connectwriter.writerow(out.astype(int)) + connectwriter.writerow(out.astype(np.int64)) def CreateNetworkConnectivity(in_drainage_line, @@ -105,8 +105,8 @@ def CreateNetworkConnectivity(in_drainage_line, stream_id_array.append(drainage_line_feature.GetField(river_id)) next_down_id_array.append(drainage_line_feature.GetField(next_down_id)) - stream_id_array = np.array(stream_id_array, dtype=np.int32) - next_down_id_array = np.array(next_down_id_array, dtype=np.int32) + stream_id_array = np.array(stream_id_array, dtype=np.int64) + next_down_id_array = np.array(next_down_id_array, dtype=np.int64) StreamIDNextDownIDToConnectivity(stream_id_array, next_down_id_array, @@ -312,9 +312,9 @@ def CreateSubsetFile(in_drainage_line, del ogr_drainage_line_shapefile - hydroid_list = np.array(hydroid_list, dtype=np.int32) + hydroid_list = np.array(hydroid_list, dtype=np.int64) if hydroseq_list: - hydroseq_list = np.array(hydroseq_list, dtype=np.int32) + hydroseq_list = np.array(hydroseq_list, dtype=np.int64) sort_order = hydroseq_list.argsort()[::-1] hydroid_list = hydroid_list[sort_order] else: From b0681dd44c5cd7e4ef4818a61a0c2ee40717f9ab Mon Sep 17 00:00:00 2001 From: Chase Hamilton Date: Thu, 11 Aug 2022 13:41:24 -0500 Subject: [PATCH 2/3] 'all references to "erdc-cm" changed to "erdc"' --- README.md | 6 +++--- docs/gis_stream_network.rst | 2 +- docs/index.rst | 4 ++-- docs/installation.rst | 6 +++--- setup.py | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index effd289..e4cd38f 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ More information about installation and the input parameters for RAPID can be fo The source code for RAPID is located at https://github.com/c-h-david/rapid/. -[![DOI](https://zenodo.org/badge/19918/erdc-cm/RAPIDpy.svg)](https://zenodo.org/badge/latestdoi/19918/erdc-cm/RAPIDpy) +[![DOI](https://zenodo.org/badge/19918/erdc/RAPIDpy.svg)](https://zenodo.org/badge/latestdoi/19918/erdc-cm/RAPIDpy) -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-yellow.svg)](https://github.com/erdc-cm/RAPIDpy/blob/master/LICENSE) +[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-yellow.svg)](https://github.com/erdc/RAPIDpy/blob/master/LICENSE) [![PyPI version](https://badge.fury.io/py/RAPIDpy.svg)](https://badge.fury.io/py/RAPIDpy) @@ -60,5 +60,5 @@ Ahmad A Tavakoly. (2017). RAPID input files corresponding to the Mississippi Riv ## Other tools to prepare input for RAPID - For ESRI users: https://github.com/Esri/python-toolbox-for-rapid -- Modified version of the ESRI RAPID Toolbox: https://github.com/erdc-cm/python-toolbox-for-rapid +- Modified version of the ESRI RAPID Toolbox: https://github.com/erdc/python-toolbox-for-rapid - For the NHDPlus dataset: https://github.com/c-h-david/RRR diff --git a/docs/gis_stream_network.rst b/docs/gis_stream_network.rst index 45857ef..0d5b9b4 100644 --- a/docs/gis_stream_network.rst +++ b/docs/gis_stream_network.rst @@ -7,7 +7,7 @@ Using ArcHydro to Generate Stream Network See: - https://github.com/Esri/python-toolbox-for-rapid -- https://github.com/erdc-cm/python-toolbox-for-rapid +- https://github.com/erdc/python-toolbox-for-rapid Using TauDEM to Generate Stream Network --------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 782a2e3..5aa9c4d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,7 +26,7 @@ https://github.com/c-h-david/rapid. .. |Coverage Status| image:: https://coveralls.io/repos/github/erdc/RAPIDpy/badge.svg?branch=master :target: https://coveralls.io/github/erdc/RAPIDpy .. |License (3-Clause BSD)| image:: https://img.shields.io/badge/license-BSD%203--Clause-yellow.svg - :target: https://github.com/erdc-cm/RAPIDpy/blob/master/LICENSE + :target: https://github.com/erdc/RAPIDpy/blob/master/LICENSE Contents: @@ -90,7 +90,7 @@ Other tools to prepare input for RAPID --------------------------------------- - For ESRI users: https://github.com/Esri/python-toolbox-for-rapid -- Modified version of the ESRI RAPID Toolbox: https://github.com/erdc-cm/python-toolbox-for-rapid +- Modified version of the ESRI RAPID Toolbox: https://github.com/erdc/python-toolbox-for-rapid - For the NHDPlus dataset: https://github.com/c-h-david/RRR diff --git a/docs/installation.rst b/docs/installation.rst index 563cfa6..364ff74 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -79,11 +79,11 @@ or from https://conda.io/miniconda.html. This is how you get the most up-to-date version of the code. -.. note:: If you don't have git, you can download the code from https://github.com/erdc-cm/RAPIDpy +.. note:: If you don't have git, you can download the code from https://github.com/erdc/RAPIDpy :: - $ git clone https://github.com/erdc-cm/RAPIDpy.git + $ git clone https://github.com/erdc/RAPIDpy.git $ cd RAPIDpy $ conda env create -f rapidpy_env.yml $ conda activate rapidpy_env @@ -93,7 +93,7 @@ To develop on the latest version: :: - $ git clone https://github.com/erdc-cm/RAPIDpy.git + $ git clone https://github.com/erdc/RAPIDpy.git $ cd RAPIDpy $ conda env create -f rapidpy_env.yml $ conda activate rapidpy_env diff --git a/setup.py b/setup.py index 3bff51f..ef0b48f 100644 --- a/setup.py +++ b/setup.py @@ -11,12 +11,12 @@ 'parameters for RAPID can be found at http://rapid-hub.org.' ' The source code for RAPID is located at ' 'https://github.com/c-h-david/rapid/. \n\n' - '.. image:: https://zenodo.org/badge/19918/erdc-cm/RAPIDpy.svg \n' - ' :target: https://zenodo.org/badge/latestdoi/19918/erdc-cm/RAPIDpy', + '.. image:: https://zenodo.org/badge/19918/erdc/RAPIDpy.svg \n' + ' :target: https://zenodo.org/badge/latestdoi/19918/erdc/RAPIDpy', keywords='RAPID', author='Alan Dee Snow', author_email='alan.d.snow@usace.army.mil', - url='https://github.com/erdc-cm/RAPIDpy', + url='https://github.com/erdc/RAPIDpy', license='BSD 3-Clause', packages=find_packages(), package_data={'': ['gis/lsm_grids/*.nc']}, From 30f6a521207f9dacb8e3a8c53de1c928d353b8a6 Mon Sep 17 00:00:00 2001 From: Chase Hamilton Date: Thu, 11 Aug 2022 14:36:55 -0500 Subject: [PATCH 3/3] 'all references to "erdc-cm" changed to "erdc"' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4cd38f..30f2eff 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ More information about installation and the input parameters for RAPID can be fo The source code for RAPID is located at https://github.com/c-h-david/rapid/. -[![DOI](https://zenodo.org/badge/19918/erdc/RAPIDpy.svg)](https://zenodo.org/badge/latestdoi/19918/erdc-cm/RAPIDpy) +[![DOI](https://zenodo.org/badge/19918/erdc/RAPIDpy.svg)](https://zenodo.org/badge/latestdoi/19918/erdc/RAPIDpy) [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-yellow.svg)](https://github.com/erdc/RAPIDpy/blob/master/LICENSE)