tlpytools 0.2.9__tar.gz → 0.2.10__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 (60) hide show
  1. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/copilot-instructions.md +2 -2
  2. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/workflows/deploy.yml +1 -1
  3. {tlpytools-0.2.9 → tlpytools-0.2.10}/CHANGELOG.md +13 -0
  4. {tlpytools-0.2.9 → tlpytools-0.2.10}/DEVELOPER_GUIDE.md +2 -2
  5. {tlpytools-0.2.9 → tlpytools-0.2.10}/PKG-INFO +1 -1
  6. {tlpytools-0.2.9 → tlpytools-0.2.10}/pyproject.toml +1 -1
  7. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/__init__.py +1 -1
  8. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/orchestrator.py +46 -35
  9. {tlpytools-0.2.9 → tlpytools-0.2.10}/uv.lock +1 -1
  10. {tlpytools-0.2.9 → tlpytools-0.2.10}/.env.example +0 -0
  11. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/skills/README.md +0 -0
  12. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/skills/prepare-official-release/SKILL.md +0 -0
  13. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/workflows/code-formatting-pr.yml +0 -0
  14. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/workflows/code-formatting.yml +0 -0
  15. {tlpytools-0.2.9 → tlpytools-0.2.10}/.github/workflows/test.yml +0 -0
  16. {tlpytools-0.2.9 → tlpytools-0.2.10}/.gitignore +0 -0
  17. {tlpytools-0.2.9 → tlpytools-0.2.10}/.pre-commit-config.yaml +0 -0
  18. {tlpytools-0.2.9 → tlpytools-0.2.10}/.python-version +0 -0
  19. {tlpytools-0.2.9 → tlpytools-0.2.10}/ENVIRONMENT_VARIABLES.md +0 -0
  20. {tlpytools-0.2.9 → tlpytools-0.2.10}/Makefile +0 -0
  21. {tlpytools-0.2.9 → tlpytools-0.2.10}/README.md +0 -0
  22. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/adls_server.md +0 -0
  23. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/azure_credential_manager.md +0 -0
  24. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/diagrams/README.md +0 -0
  25. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/diagrams/orca_cloud_workflow.drawio +0 -0
  26. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/diagrams/orca_detailed_steps.drawio +0 -0
  27. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/diagrams/orca_file_structure.drawio +0 -0
  28. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/diagrams/orca_local_workflow.drawio +0 -0
  29. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/diagrams/orca_main_features.drawio +0 -0
  30. {tlpytools-0.2.9 → tlpytools-0.2.10}/docs/unified_logging.md +0 -0
  31. {tlpytools-0.2.9 → tlpytools-0.2.10}/requirements.txt +0 -0
  32. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/examples/batchtask.py +0 -0
  33. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/examples/data_files/example.csv +0 -0
  34. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/examples/mydataproject.py +0 -0
  35. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/examples/readwritedata.py +0 -0
  36. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/examples/unified_logging.py +0 -0
  37. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/adls_server.py +0 -0
  38. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/azure_credential.py +0 -0
  39. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/config.py +0 -0
  40. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/data.py +0 -0
  41. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/data_store.py +0 -0
  42. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/env_config.py +0 -0
  43. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/log.py +0 -0
  44. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/README.md +0 -0
  45. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/__init__.py +0 -0
  46. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/__main__.py +0 -0
  47. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/batch_task_runner.py +0 -0
  48. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/cli.py +0 -0
  49. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/orca_model_config_barebone.yaml +0 -0
  50. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/orca/orca_model_config_example.yaml +0 -0
  51. {tlpytools-0.2.9 → tlpytools-0.2.10}/src/tlpytools/sql_server.py +0 -0
  52. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/README.md +0 -0
  53. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/__init__.py +0 -0
  54. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/conftest.py +0 -0
  55. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/run_tests.py +0 -0
  56. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/test_azure_credential.py +0 -0
  57. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/test_basic.py +0 -0
  58. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/test_core.py +0 -0
  59. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/test_orca_integration.py +0 -0
  60. {tlpytools-0.2.9 → tlpytools-0.2.10}/tests/test_orca_unit.py +0 -0
@@ -98,8 +98,8 @@ Interpretation for agent PRs:
98
98
 
99
99
  Observed result:
100
100
  - Build succeeds and produces:
101
- - `dist/tlpytools-0.2.9.tar.gz`
102
- - `dist/tlpytools-0.2.9-py3-none-any.whl`
101
+ - `dist/tlpytools-0.2.10.tar.gz`
102
+ - `dist/tlpytools-0.2.10-py3-none-any.whl`
103
103
 
104
104
  ### 5) Run
105
105
  - ORCA CLI (module form):
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
  inputs:
6
6
  version:
7
- description: 'Version number to release (e.g., 0.2.9)'
7
+ description: 'Version number to release (e.g., 0.2.10)'
8
8
  required: true
9
9
  type: string
10
10
  prerelease:
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to TLPyTools will be documented in this file.
4
4
 
5
+ ## [0.2.10]
6
+
7
+ ### Fixed
8
+ - **`_copy_input_data`: `NameError` on glob-matched files with an `exclude` list:**
9
+ - The glob-pattern branch referenced an undefined variable `exclude_names` instead of the in-scope `entry_exclude` set
10
+ - Files matched by a glob pattern are now correctly skipped when their basename appears in the per-entry `exclude` list
11
+ - **`_upload_component_zips`: `IndexError`/`TypeError` when `steps` is empty:**
12
+ - `self.state.get("steps")[current_step_index - 1]` would raise if the steps list was empty or `None`
13
+ - Now guards with `steps = self.state.get("steps") or []` and uses conditional indexing; returns early with a log message if steps is empty
14
+ - **`sync_with_adls`: `TypeError` when keyword arguments are supplied:**
15
+ - `**kwargs` was forwarded to `_sync_with_cloud(self, direction: str)` which does not accept extra keyword arguments, causing a `TypeError` for any caller passing additional options
16
+ - The unused `**kwargs` forwarding has been removed from the `download` and `upload` branches
17
+
5
18
  ## [0.2.9]
6
19
 
7
20
  ### Changed
@@ -200,7 +200,7 @@ make check-all
200
200
  4. Click **"Run workflow"** button
201
201
  5. Fill in the required information:
202
202
  - **Branch**: Select `main` (or your release branch)
203
- - **Version number**: Enter the new version (e.g., `0.2.9`)
203
+ - **Version number**: Enter the new version (e.g., `0.2.10`)
204
204
  - **Is this a pre-release?**: Check if this is a pre-release version
205
205
 
206
206
  #### 3. Monitor the Release
@@ -219,7 +219,7 @@ After the workflow completes:
219
219
 
220
220
  ```bash
221
221
  # Verify the package is available on PyPI
222
- pip install tlpytools==0.2.9 # Replace with your version
222
+ pip install tlpytools==0.2.10 # Replace with your version
223
223
 
224
224
  # Test installation in a fresh environment
225
225
  python -c "import tlpytools; print(tlpytools.__version__)"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tlpytools
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: TransLink's Python Tools - A comprehensive toolkit for transportation modeling and forecasting
5
5
  Project-URL: Homepage, https://github.com/TransLinkForecasting/tlpytools
6
6
  Project-URL: Bug Tracker, https://github.com/TransLinkForecasting/tlpytools/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tlpytools"
7
- version = "0.2.9"
7
+ version = "0.2.10"
8
8
  description = "TransLink's Python Tools - A comprehensive toolkit for transportation modeling and forecasting"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10.0, <3.13"
@@ -2,7 +2,7 @@
2
2
  TLPyTools - A set of tools for building models at the TransLink Forecasting Team
3
3
  """
4
4
 
5
- __version__ = "0.2.9"
5
+ __version__ = "0.2.10"
6
6
 
7
7
  # Core modules that should always be available (minimal dependencies)
8
8
  from . import log
@@ -1991,11 +1991,28 @@ class OrcaScenario:
1991
1991
  conflict_files = 0
1992
1992
 
1993
1993
  # Walk through the source directory and copy files
1994
- for root, _, files in os.walk(source_dir):
1994
+ for root, dirs, files in os.walk(source_dir):
1995
1995
  # Calculate the relative path to maintain directory structure
1996
1996
  rel_path = os.path.relpath(root, source_dir)
1997
1997
  target_subdir = os.path.join(target_dir, rel_path)
1998
1998
 
1999
+ # Prune excluded directories so os.walk does not descend into them.
2000
+ # Use forward slashes for consistent cross-platform pattern matching.
2001
+ if exclude_patterns:
2002
+ rel_path_fwd = rel_path.replace(os.sep, "/")
2003
+ pruned = []
2004
+ for d in dirs:
2005
+ dir_rel = (
2006
+ d if rel_path == "." else f"{rel_path_fwd}/{d}"
2007
+ ).replace(os.sep, "/")
2008
+ if not any(
2009
+ fnmatch.fnmatch(dir_rel, p)
2010
+ or fnmatch.fnmatch(dir_rel + "/", p)
2011
+ for p in exclude_patterns
2012
+ ):
2013
+ pruned.append(d)
2014
+ dirs[:] = pruned
2015
+
1999
2016
  # Create the target subdirectory if it doesn't exist
2000
2017
  os.makedirs(target_subdir, exist_ok=True)
2001
2018
 
@@ -2004,14 +2021,19 @@ class OrcaScenario:
2004
2021
  source_file = os.path.join(root, file)
2005
2022
  target_file = os.path.join(target_subdir, file)
2006
2023
 
2007
- # Apply include/exclude patterns if provided
2024
+ # Apply include/exclude patterns against the relative file path.
2025
+ rel_file = (
2026
+ file if rel_path == "." else f"{rel_path}/{file}"
2027
+ ).replace(os.sep, "/")
2008
2028
  if include_patterns and not any(
2009
- fnmatch.fnmatch(file, pattern) for pattern in include_patterns
2029
+ fnmatch.fnmatch(rel_file, pattern)
2030
+ for pattern in include_patterns
2010
2031
  ):
2011
2032
  skipped_files += 1
2012
2033
  continue
2013
2034
  if exclude_patterns and any(
2014
- fnmatch.fnmatch(file, pattern) for pattern in exclude_patterns
2035
+ fnmatch.fnmatch(rel_file, pattern)
2036
+ for pattern in exclude_patterns
2015
2037
  ):
2016
2038
  skipped_files += 1
2017
2039
  continue
@@ -2283,23 +2305,7 @@ class OrcaScenario:
2283
2305
  "Failed to copy log file %s to error dump: %s", log_name, e
2284
2306
  )
2285
2307
 
2286
- # 4. Copy outputs directory if it exists
2287
- outputs_dir = os.path.join(self.scenario_path, OUTPUTS_DIR)
2288
- if os.path.exists(outputs_dir):
2289
- outputs_dump_dir = os.path.join(error_dump_dir, OUTPUTS_DIR)
2290
- self.logger.debug("Copying outputs directory for error analysis")
2291
-
2292
- success = self.copy_template_directory(
2293
- source_dir=outputs_dir,
2294
- target_dir=outputs_dump_dir,
2295
- overwrite=True,
2296
- export_copy_log=False,
2297
- )
2298
-
2299
- if success:
2300
- error_info["dump_contents"].append(f"{OUTPUTS_DIR}/")
2301
-
2302
- # 5. Optionally copy entire scenario (excluding the error dump itself)
2308
+ # 4. Optionally copy entire scenario (excluding the error dump itself)
2303
2309
  if include_all_scenario:
2304
2310
  self.logger.debug("Including full scenario content in error dump")
2305
2311
  full_dump_dir = os.path.join(error_dump_dir, "full_scenario")
@@ -2315,14 +2321,14 @@ class OrcaScenario:
2315
2321
  if success:
2316
2322
  error_info["dump_contents"].append("full_scenario/")
2317
2323
 
2318
- # 6. Save error information
2324
+ # 5. Save error information
2319
2325
  error_info_file = os.path.join(error_dump_dir, "error_info.json")
2320
2326
  with open(error_info_file, "w", encoding="utf-8") as f:
2321
2327
  json.dump(error_info, f, indent=2, ensure_ascii=False)
2322
2328
 
2323
2329
  error_info["dump_contents"].append("error_info.json")
2324
2330
 
2325
- # 7. Create a zip archive of the error dump
2331
+ # 6. Create a zip archive of the error dump
2326
2332
  zip_name = f"error_dump_{step_name}_iter{iteration}_{timestamp}.zip"
2327
2333
  zip_path = os.path.join(error_dump_base, zip_name)
2328
2334
 
@@ -3219,7 +3225,7 @@ class OrcaOrchestrator:
3219
3225
  matching_files = glob.glob(full_source_path)
3220
3226
  if matching_files:
3221
3227
  for file_path in matching_files:
3222
- if os.path.basename(file_path) in exclude_names:
3228
+ if os.path.basename(file_path) in entry_exclude:
3223
3229
  continue
3224
3230
  self.scenario.copy_template_file(
3225
3231
  source_file=file_path,
@@ -3876,7 +3882,7 @@ class OrcaOrchestrator:
3876
3882
  error_config = self.config.get("error_handling", {})
3877
3883
  create_dump = error_config.get("create_error_dump", True)
3878
3884
  include_full_scenario = error_config.get(
3879
- "include_all_files_in_dump", True
3885
+ "include_all_files_in_dump", False
3880
3886
  )
3881
3887
 
3882
3888
  if create_dump and self.mode == "cloud_production":
@@ -5442,8 +5448,14 @@ class OrcaOrchestrator:
5442
5448
  # Determine if this is scenario initialization or step completion
5443
5449
  current_iteration = self.state.get_display_iteration()
5444
5450
  current_step_index = self.state.get("current_step_index", 0)
5445
- step_name = self.state.get("steps")[current_step_index - 1]
5446
5451
  is_scenario_init = current_iteration == 1 and current_step_index == 0
5452
+ steps = self.state.get("steps") or []
5453
+ if not steps:
5454
+ self.logger.info("No steps defined, skipping component zips")
5455
+ return True
5456
+ step_name = (
5457
+ steps[current_step_index - 1] if current_step_index > 0 else None
5458
+ )
5447
5459
 
5448
5460
  for component_name in self.config["sub_components"].keys():
5449
5461
  component_dir = os.path.join(self.scenario_path, component_name)
@@ -7090,10 +7102,10 @@ class OrcaOrchestrator:
7090
7102
  return True
7091
7103
 
7092
7104
  elif direction == "download":
7093
- return self._sync_with_cloud(direction="download", **kwargs)
7105
+ return self._sync_with_cloud(direction="download")
7094
7106
 
7095
7107
  elif direction == "upload":
7096
- return self._sync_with_cloud(direction="upload", **kwargs)
7108
+ return self._sync_with_cloud(direction="upload")
7097
7109
 
7098
7110
  else:
7099
7111
  self.logger.error("Invalid sync direction: %s", direction)
@@ -7471,20 +7483,19 @@ class OrcaUtil:
7471
7483
  if output_dir and not os.path.exists(output_dir):
7472
7484
  os.makedirs(output_dir, exist_ok=True)
7473
7485
 
7474
- # Extract OMX file from zip
7486
+ # Stream directly from zip to output - avoids loading entire file into RAM
7475
7487
  with zipfile.ZipFile(zip_path, "r") as zf:
7476
7488
  try:
7477
- with zf.open(omx_path_in_zip) as omx_bytes:
7478
- byte_data = omx_bytes.read()
7489
+ with (
7490
+ zf.open(omx_path_in_zip) as omx_bytes,
7491
+ open(output_path, "wb") as f,
7492
+ ):
7493
+ shutil.copyfileobj(omx_bytes, f)
7479
7494
  except KeyError as err:
7480
7495
  raise FileNotFoundError(
7481
7496
  f"File '{omx_path_in_zip}' not found in zip archive '{zip_path}'"
7482
7497
  ) from err
7483
7498
 
7484
- # Write to output path
7485
- with open(output_path, "wb") as f:
7486
- f.write(byte_data)
7487
-
7488
7499
  return True
7489
7500
 
7490
7501
  except FileNotFoundError:
@@ -4649,7 +4649,7 @@ wheels = [
4649
4649
 
4650
4650
  [[package]]
4651
4651
  name = "tlpytools"
4652
- version = "0.2.9"
4652
+ version = "0.2.10"
4653
4653
  source = { editable = "." }
4654
4654
  dependencies = [
4655
4655
  { name = "azure-core" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes