ras-commander 0.1.5__py2.py3-none-any.whl → 0.20.dev0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ras_commander/README.md +187 -0
- ras_commander/RasCommander.py +456 -0
- ras_commander/RasExamples.py +304 -0
- ras_commander/RasGeo.py +83 -0
- ras_commander/RasPlan.py +1216 -0
- ras_commander/RasPrj.py +400 -0
- ras_commander/RasUnsteady.py +53 -0
- ras_commander/RasUtils.py +283 -0
- ras_commander/__init__.py +33 -0
- ras_commander/_version.py +2 -2
- ras_commander-0.20.dev0.dist-info/METADATA +342 -0
- ras_commander-0.20.dev0.dist-info/RECORD +15 -0
- {ras_commander-0.1.5.dist-info → ras_commander-0.20.dev0.dist-info}/WHEEL +1 -1
- ras_commander/execution.py +0 -315
- ras_commander/file_operations.py +0 -173
- ras_commander/geometry_operations.py +0 -184
- ras_commander/plan_operations.py +0 -307
- ras_commander/project_config.py +0 -64
- ras_commander/project_init.py +0 -174
- ras_commander/project_management.py +0 -227
- ras_commander/project_setup.py +0 -15
- ras_commander/unsteady_operations.py +0 -172
- ras_commander/utilities.py +0 -195
- ras_commander-0.1.5.dist-info/METADATA +0 -133
- ras_commander-0.1.5.dist-info/RECORD +0 -17
- {ras_commander-0.1.5.dist-info → ras_commander-0.20.dev0.dist-info}/LICENSE +0 -0
- {ras_commander-0.1.5.dist-info → ras_commander-0.20.dev0.dist-info}/top_level.txt +0 -0
@@ -1,133 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: ras_commander
|
3
|
-
Version: 0.1.5
|
4
|
-
Summary: A library for automating HEC-RAS operations using python functions.
|
5
|
-
Author-email: "William Katzenmeyer, P.E., C.F.M." <heccommander@gmail.com>
|
6
|
-
Project-URL: Homepage, https://github.com/yourusername/ras_commander
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
9
|
-
Classifier: Operating System :: OS Independent
|
10
|
-
Requires-Python: >=3.9
|
11
|
-
Description-Content-Type: text/markdown
|
12
|
-
License-File: LICENSE
|
13
|
-
|
14
|
-
## RAS-Commander Library Organization
|
15
|
-
|
16
|
-
| Directory/File | Purpose |
|
17
|
-
|---|---|
|
18
|
-
| ras_commander/__init__.py | Initializes the library and defines the public API. |
|
19
|
-
| ras_commander/execution.py | Handles execution of HEC-RAS simulations. |
|
20
|
-
| ras_commander/file_operations.py | Provides functions for reading and parsing HEC-RAS project files. |
|
21
|
-
| ras_commander/geometry_operations.py | Provides functions for manipulating geometry files. |
|
22
|
-
| ras_commander/plan_operations.py | Provides functions for modifying and updating plan files. |
|
23
|
-
| ras_commander/project_config.py | Defines the ProjectConfig class for managing project-level information. |
|
24
|
-
| ras_commander/project_init.py | Provides the `init_ras_project` function to initialize a project. |
|
25
|
-
| ras_commander/project_management.py | Provides functions for managing HEC-RAS projects (e.g., copying files, updating project file). |
|
26
|
-
| ras_commander/project_setup.py | Provides helper functions for project setup (e.g., finding project file, loading project data). |
|
27
|
-
| ras_commander/unsteady_operations.py | Provides functions for manipulating unsteady flow files. |
|
28
|
-
| ras_commander/utilities.py | Provides general utility functions (e.g., file backup, directory creation). |
|
29
|
-
|
30
|
-
|
31
|
-
## Project Organization Diagram
|
32
|
-
|
33
|
-
```
|
34
|
-
ras_commander
|
35
|
-
├── execution.py
|
36
|
-
├── file_operations.py
|
37
|
-
├── geometry_operations.py
|
38
|
-
├── plan_operations.py
|
39
|
-
├── project_config.py
|
40
|
-
├── project_init.py
|
41
|
-
├── project_management.py
|
42
|
-
├── project_setup.py
|
43
|
-
├── unsteady_operations.py
|
44
|
-
└── utilities.py
|
45
|
-
```
|
46
|
-
|
47
|
-
## Functions Overview
|
48
|
-
|
49
|
-
| Function | Arguments | Purpose |
|
50
|
-
|---|---|---|
|
51
|
-
| `init_ras_project` | `ras_project_folder`, `hecras_exe_path` | Initializes a HEC-RAS project by setting up the `ProjectConfig` with project details. |
|
52
|
-
| `compute_hecras_plan` | `plan_file` | Executes a HEC-RAS plan file. |
|
53
|
-
| `compute_hecras_plan_from_folder` | `test_plan_file`, `test_folder_path` | Execute a single HEC-RAS plan from a folder other than the project path.
|
54
|
-
| `recreate_test_function` | `project_folder` | Recreates the -test function from the HEC-RAS interface, primarily by copying the project directory, forcing recomputation, and running each plan. |
|
55
|
-
| `run_plans_parallel` | `config`, `max_workers`, `cores_per_run` | Run HEC-RAS plans in parallel. |
|
56
|
-
| `run_all_plans_parallel` | `project_folder`, `hecras_exe_path` | Run all HEC-RAS plans in parallel from a project folder path. |
|
57
|
-
| `find_hecras_project_file` | `folder_path` | Locates the HEC-RAS project file (.prj) within a given folder. |
|
58
|
-
| `get_project_name` | `project_path` | Extracts the project name from the project file path. |
|
59
|
-
| `get_plan_entries` | `project_file` | Parses the project file to extract plan file information into a DataFrame. |
|
60
|
-
| `get_flow_entries` | `project_file` | Parses the project file to extract steady flow file information into a DataFrame. |
|
61
|
-
| `get_unsteady_entries` | `project_file` | Parses the project file to extract unsteady flow file information into a DataFrame. |
|
62
|
-
| `get_geom_entries` | `project_file` | Parses the project file to extract geometry file information into a DataFrame. |
|
63
|
-
| `clear_geometry_preprocessor_files` | `plan_file` | Deletes the geometry preprocessor files (.cXX) associated with a plan file. |
|
64
|
-
| `clear_geometry_preprocessor_files_for_all_plans` | | Deletes geometry preprocessor files for all plans in the project directory. |
|
65
|
-
| `copy_geometry_files` | `dst_folder`, `template_geom` | Copies geometry files from a template to a destination folder, assigning the next available geometry number. |
|
66
|
-
| `rename_geometry_files` | `old_number`, `new_number` | Renames geometry files (both .gXX and .gXX.hdf) in the project folder. |
|
67
|
-
| `update_geometry_reference_in_plan` | `plan_file`, `new_geometry_number` | Updates the "Geom File=" entry in a plan file to reference a new geometry number. |
|
68
|
-
| `apply_geometry_to_plan` | `plan_file`, `geometry_number` | Sets the geometry file used by a plan file. |
|
69
|
-
| `apply_flow_to_plan` | `plan_file`, `flow_number` | Sets the steady flow file used by a plan file. |
|
70
|
-
| `copy_plan_from_template` | `template_plan` | Creates a new plan file by copying a template and updates the project file with the new plan entry. |
|
71
|
-
| `get_next_available_number` | `existing_numbers` | Finds the next available number (e.g., for plans, unsteady flows) based on existing ones. |
|
72
|
-
| `apply_unsteady_to_plan` | `plan_file`, `unsteady_number` | Sets the unsteady flow file used by a plan file. |
|
73
|
-
| `set_num_cores` | `plan_file`, `num_cores` | Sets the maximum number of cores to be used for a plan file. |
|
74
|
-
| `update_geompre_flags` | `file_path`, `run_htab_value`, `use_ib_tables_value` | Updates the geometry preprocessor flags in a plan file. |
|
75
|
-
| `get_plan_full_path` | `plan_number` | Returns the full path to a plan file based on its number. |
|
76
|
-
| `get_results_full_path` | `plan_number` | Returns the full path to a plan's results file (.hdf) based on its number. |
|
77
|
-
| `get_flow_full_path` | `flow_number` | Returns the full path to a steady flow file based on its number. |
|
78
|
-
| `get_unsteady_full_path` | `unsteady_number` | Returns the full path to an unsteady flow file based on its number. |
|
79
|
-
| `get_geom_full_path` | `geometry_number` | Returns the full path to a geometry file based on its number. |
|
80
|
-
| `copy_unsteady_files` | `dst_folder`, `template_unsteady` | Copies unsteady flow files from a template to a destination folder, assigning the next available unsteady number. |
|
81
|
-
| `rename_unsteady_files` | `old_number`, `new_number` | Renames unsteady flow files (both .uXX and .uXX.hdf) in the project folder. |
|
82
|
-
| `update_unsteady_reference_in_plan` | `plan_file`, `new_unsteady_number` | Updates the "Unsteady File=" entry in a plan file to reference a new unsteady flow number. |
|
83
|
-
| `modify_unsteady_flow_parameters` | `unsteady_file`, `modifications` | Modifies parameters within an unsteady flow file based on a dictionary of changes. |
|
84
|
-
| `create_backup` | `file_path`, `backup_suffix` | Creates a backup copy of a file. |
|
85
|
-
| `restore_from_backup` | `backup_path`, `remove_backup` | Restores a file from a backup copy. |
|
86
|
-
| `safe_remove` | `file_path` | Removes a file if it exists, handling potential errors. |
|
87
|
-
| `ensure_directory` | `directory_path` | Creates a directory if it does not exist. |
|
88
|
-
| `list_files_with_extension` | `extension` | Lists files with a specific extension in the project directory. |
|
89
|
-
| `get_file_size` | `file_path` | Returns the size of a file in bytes. |
|
90
|
-
| `get_modification_time` | `file_path` | Returns the last modification time of a file. |
|
91
|
-
| `get_plan_path` | `current_plan_number` | Returns the full path to a plan file based on its number. |
|
92
|
-
| `retry_remove_folder` | `folder_path`, `max_attempts`, `initial_delay` | Attempts to remove a folder with retry and a delay. |
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
## Potential Uses of RAS-Commander Functions
|
97
|
-
|
98
|
-
The RAS-Commander library offers a wide range of functionalities that can be used to automate various aspects of HEC-RAS modeling workflows. Here are some potential uses:
|
99
|
-
|
100
|
-
**1. Automated Plan Creation and Execution:**
|
101
|
-
|
102
|
-
* **Batch processing of multiple scenarios:** RAS-Commander allows you to create new plan files based on templates, modify plan parameters (e.g., geometry, flow, unsteady flow files, number of cores), and execute them in parallel. This can be useful for analyzing multiple scenarios with different inputs or model configurations.
|
103
|
-
* **Sensitivity analysis and optimization:** By combining RAS-Commander with other libraries (e.g., for parameter sampling or optimization), you can automate sensitivity analysis and parameter optimization studies.
|
104
|
-
* **Monte Carlo simulations:** RAS-Commander can be used to automate the execution of Monte Carlo simulations by creating multiple plan files with randomly sampled input parameters.
|
105
|
-
|
106
|
-
**2. Project Management and Organization:**
|
107
|
-
|
108
|
-
* **Automated file management:** Functions for copying, renaming, and updating file references help maintain consistency and organization within your HEC-RAS project.
|
109
|
-
* **Backup and restore functionalities:** Ensure project integrity by creating backups of project files and restoring them when needed.
|
110
|
-
* **Project setup and initialization:** Streamline the process of setting up new HEC-RAS projects with standardized configurations.
|
111
|
-
|
112
|
-
**3. Advanced Modeling Techniques:**
|
113
|
-
|
114
|
-
* **Coupled modeling:** RAS-Commander can be used to automate the setup and execution of coupled models (e.g., HEC-RAS with other hydrodynamic or hydrologic models).
|
115
|
-
* **Data assimilation and calibration:** By integrating RAS-Commander with data assimilation or calibration tools, you can automate the process of updating model parameters based on observed data.
|
116
|
-
* **Post-processing and analysis:** RAS-Commander can be used to extract results from HEC-RAS output files and perform post-processing and analysis tasks.
|
117
|
-
|
118
|
-
|
119
|
-
**4. Integration with Other Tools:**
|
120
|
-
|
121
|
-
* **Python scripting and automation:** RAS-Commander can be easily integrated into Python scripts and workflows for more complex automation tasks.
|
122
|
-
* **Web applications and dashboards:** Develop web applications and dashboards that allow users to interact with HEC-RAS models and visualize results through a user-friendly interface.
|
123
|
-
* **Integration with GIS software:** RAS-Commander can be used to link HEC-RAS models with GIS software for spatial analysis and visualization.
|
124
|
-
|
125
|
-
|
126
|
-
**Examples:**
|
127
|
-
|
128
|
-
* **Floodplain mapping:** Automate the creation of floodplain maps for different return periods by creating and executing multiple plan files with varying flow conditions.
|
129
|
-
* **Dam break analysis:** Automate the setup and execution of dam break simulations by modifying unsteady flow parameters and boundary conditions.
|
130
|
-
* **Bridge scour analysis:** Automate the assessment of bridge scour potential by integrating HEC-RAS with bridge scour analysis tools.
|
131
|
-
|
132
|
-
|
133
|
-
By automating repetitive tasks and providing a framework for managing complex workflows, RAS-Commander can significantly improve the efficiency and reproducibility of HEC-RAS modeling projects. This can lead to better decision-making and more accurate and reliable results.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
ras_commander/__init__.py,sha256=cJpdawx13KBsje6N56a30fqJ_qOy71sPLqs7YT7YSD0,205
|
2
|
-
ras_commander/_version.py,sha256=zBVX2byWL6NrFlwjvahpnvSqDsdtebZW0K9WM_cj20U,411
|
3
|
-
ras_commander/execution.py,sha256=hq2K4pIcAgch-zvV_nezxw9OpdOEenePxqWbCPFuSpw,13960
|
4
|
-
ras_commander/file_operations.py,sha256=ufi00mh52C9-off_tA0aMp3U4mm066gMkwPZYiFN8hg,7274
|
5
|
-
ras_commander/geometry_operations.py,sha256=-HhYTNEFmR64MLlfa7hxogJBCHw4iBScGFMTQLfDlJg,6961
|
6
|
-
ras_commander/plan_operations.py,sha256=I0r-4QnhSqfehy63xcreKSnE-ozzv3R-4HyO-9c3dSI,12496
|
7
|
-
ras_commander/project_config.py,sha256=zbSwSVt8F9v77QEjRUjMbLBxisiimmQO2mf7eb4juvc,2886
|
8
|
-
ras_commander/project_init.py,sha256=6eCHtqaKTXb5AK47Brs8o0fNCa0e3Jmh3QvyVhzp7n8,8330
|
9
|
-
ras_commander/project_management.py,sha256=CplIJ36ZIukm45Re9T2wQ_v96CqC9150upN06JvqYK8,9730
|
10
|
-
ras_commander/project_setup.py,sha256=nJXbi0WHwdoJsP50R2vNtL0eil5PUXZv379KiL40KPA,673
|
11
|
-
ras_commander/unsteady_operations.py,sha256=QBXUO2Mw3yzk7K9piu-Q39D_yI3BDUqLY0gweofrIWc,6808
|
12
|
-
ras_commander/utilities.py,sha256=-UeGrrWl_xp4WTROmqZliojmunMgWW7jqPM8KN4p_1Q,6807
|
13
|
-
ras_commander-0.1.5.dist-info/LICENSE,sha256=_pbd6qHnlsz1iQ-ozDW_49r86BZT6CRwO2iBtw0iN6M,457
|
14
|
-
ras_commander-0.1.5.dist-info/METADATA,sha256=XzFSGDr4PFs5pLiGiiiCLdqF4kNibEssgUmqe7F7l2o,10613
|
15
|
-
ras_commander-0.1.5.dist-info/WHEEL,sha256=qUzzGenXXuJTzyjFah76kDVqDvnk-YDzY00svnrl84w,109
|
16
|
-
ras_commander-0.1.5.dist-info/top_level.txt,sha256=i76S7eKLFC8doKcXDl3aiOr9RwT06G8adI6YuKbQDaA,14
|
17
|
-
ras_commander-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|