ras-commander 0.80.1__tar.gz → 0.80.2__tar.gz

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.
Files changed (39) hide show
  1. {ras_commander-0.80.1/ras_commander.egg-info → ras_commander-0.80.2}/PKG-INFO +1 -1
  2. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasExamples.py +26 -6
  3. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/__init__.py +1 -1
  4. {ras_commander-0.80.1 → ras_commander-0.80.2/ras_commander.egg-info}/PKG-INFO +1 -1
  5. {ras_commander-0.80.1 → ras_commander-0.80.2}/setup.py +1 -1
  6. {ras_commander-0.80.1 → ras_commander-0.80.2}/LICENSE +0 -0
  7. {ras_commander-0.80.1 → ras_commander-0.80.2}/README.md +0 -0
  8. {ras_commander-0.80.1 → ras_commander-0.80.2}/pyproject.toml +0 -0
  9. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/Decorators.py +0 -0
  10. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfBase.py +0 -0
  11. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfBndry.py +0 -0
  12. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfFluvialPluvial.py +0 -0
  13. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfInfiltration.py +0 -0
  14. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfMesh.py +0 -0
  15. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfPipe.py +0 -0
  16. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfPlan.py +0 -0
  17. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfPlot.py +0 -0
  18. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfPump.py +0 -0
  19. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfResultsMesh.py +0 -0
  20. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfResultsPlan.py +0 -0
  21. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfResultsPlot.py +0 -0
  22. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfResultsXsec.py +0 -0
  23. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfStruc.py +0 -0
  24. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfUtils.py +0 -0
  25. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/HdfXsec.py +0 -0
  26. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/LoggingConfig.py +0 -0
  27. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasCmdr.py +0 -0
  28. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasGeo.py +0 -0
  29. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasMap.py +0 -0
  30. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasPlan.py +0 -0
  31. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasPrj.py +0 -0
  32. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasUnsteady.py +0 -0
  33. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander/RasUtils.py +0 -0
  34. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander.egg-info/SOURCES.txt +0 -0
  35. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander.egg-info/dependency_links.txt +0 -0
  36. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander.egg-info/requires.txt +0 -0
  37. {ras_commander-0.80.1 → ras_commander-0.80.2}/ras_commander.egg-info/top_level.txt +0 -0
  38. {ras_commander-0.80.1 → ras_commander-0.80.2}/setup.cfg +0 -0
  39. {ras_commander-0.80.1 → ras_commander-0.80.2}/tests/test_ras_examples_initialization.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ras-commander
3
- Version: 0.80.1
3
+ Version: 0.80.2
4
4
  Summary: A Python library for automating HEC-RAS 6.x operations
5
5
  Home-page: https://github.com/gpt-cmdr/ras-commander
6
6
  Author: William M. Katzenmeyer, P.E., C.F.M.
@@ -128,11 +128,14 @@ class RasExamples:
128
128
  self._save_to_csv()
129
129
 
130
130
  @classmethod
131
- def extract_project(cls, project_names: Union[str, List[str]]) -> Union[Path, List[Path]]:
131
+ def extract_project(cls, project_names: Union[str, List[str]], output_path: Union[str, Path] = None) -> Union[Path, List[Path]]:
132
132
  """Extract one or more specific HEC-RAS projects from the zip file.
133
133
 
134
134
  Args:
135
135
  project_names: Single project name as string or list of project names
136
+ output_path: Optional path where the project folder will be placed.
137
+ Can be a relative path (creates subfolder in current directory)
138
+ or an absolute path. If None, uses default 'example_projects' folder.
136
139
 
137
140
  Returns:
138
141
  Path: Single Path object if one project extracted
@@ -151,13 +154,26 @@ class RasExamples:
151
154
  if isinstance(project_names, str):
152
155
  project_names = [project_names]
153
156
 
157
+ # Determine the output directory
158
+ if output_path is None:
159
+ # Use default 'example_projects' folder
160
+ base_output_path = cls.projects_dir
161
+ else:
162
+ # Convert to Path object
163
+ base_output_path = Path(output_path)
164
+ # If relative path, make it relative to current working directory
165
+ if not base_output_path.is_absolute():
166
+ base_output_path = Path.cwd() / base_output_path
167
+ # Create the directory if it doesn't exist
168
+ base_output_path.mkdir(parents=True, exist_ok=True)
169
+
154
170
  extracted_paths = []
155
171
 
156
172
  for project_name in project_names:
157
173
  # Check if this is a special project
158
174
  if project_name in cls.SPECIAL_PROJECTS:
159
175
  try:
160
- special_path = cls._extract_special_project(project_name)
176
+ special_path = cls._extract_special_project(project_name, base_output_path)
161
177
  extracted_paths.append(special_path)
162
178
  continue
163
179
  except Exception as e:
@@ -167,7 +183,7 @@ class RasExamples:
167
183
  # Regular project extraction logic
168
184
  logger.info("----- RasExamples Extracting Project -----")
169
185
  logger.info(f"Extracting project '{project_name}'")
170
- project_path = cls.projects_dir
186
+ project_path = base_output_path
171
187
 
172
188
  if (project_path / project_name).exists():
173
189
  logger.info(f"Project '{project_name}' already exists. Deleting existing folder...")
@@ -447,12 +463,13 @@ class RasExamples:
447
463
  return int(number * units[unit])
448
464
 
449
465
  @classmethod
450
- def _extract_special_project(cls, project_name: str) -> Path:
466
+ def _extract_special_project(cls, project_name: str, output_path: Path = None) -> Path:
451
467
  """
452
468
  Download and extract special projects that are not in the main zip file.
453
469
 
454
470
  Args:
455
471
  project_name: Name of the special project ('NewOrleansMetro' or 'BeaverLake')
472
+ output_path: Base output directory path. If None, uses cls.projects_dir
456
473
 
457
474
  Returns:
458
475
  Path: Path to the extracted project directory
@@ -466,8 +483,11 @@ class RasExamples:
466
483
  logger.info(f"----- RasExamples Extracting Special Project -----")
467
484
  logger.info(f"Extracting special project '{project_name}'")
468
485
 
486
+ # Use provided output_path or default
487
+ base_path = output_path if output_path else cls.projects_dir
488
+
469
489
  # Create the project directory
470
- project_path = cls.projects_dir / project_name
490
+ project_path = base_path / project_name
471
491
 
472
492
  # Check if already exists
473
493
  if project_path.exists():
@@ -484,7 +504,7 @@ class RasExamples:
484
504
 
485
505
  # Download the zip file
486
506
  url = cls.SPECIAL_PROJECTS[project_name]
487
- zip_file_path = cls.projects_dir / f"{project_name}_temp.zip"
507
+ zip_file_path = base_path / f"{project_name}_temp.zip"
488
508
 
489
509
  logger.info(f"Downloading special project from: {url}")
490
510
  logger.info("This may take a few moments...")
@@ -10,7 +10,7 @@ try:
10
10
  __version__ = version("ras-commander")
11
11
  except PackageNotFoundError:
12
12
  # package is not installed
13
- __version__ = "0.80.1"
13
+ __version__ = "0.80.2"
14
14
 
15
15
  # Set up logging
16
16
  setup_logging()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ras-commander
3
- Version: 0.80.1
3
+ Version: 0.80.2
4
4
  Summary: A Python library for automating HEC-RAS 6.x operations
5
5
  Home-page: https://github.com/gpt-cmdr/ras-commander
6
6
  Author: William M. Katzenmeyer, P.E., C.F.M.
@@ -28,7 +28,7 @@ class CustomBuildPy(build_py):
28
28
 
29
29
  setup(
30
30
  name="ras-commander",
31
- version="0.80.1",
31
+ version="0.80.2",
32
32
  packages=find_packages(),
33
33
  include_package_data=True,
34
34
  python_requires='>=3.10',
File without changes
File without changes
File without changes