Skip to content

Feature/7399 add tidal currents and eac mooring for oceancurrent#1263

Merged
shaunahu merged 6 commits intomasterfrom
feature/7399-add-tidal-currents-and-eac-mooring-for-oceancurrent
Sep 8, 2025
Merged

Feature/7399 add tidal currents and eac mooring for oceancurrent#1263
shaunahu merged 6 commits intomasterfrom
feature/7399-add-tidal-currents-and-eac-mooring-for-oceancurrent

Conversation

@weited
Copy link
Contributor

@weited weited commented Sep 8, 2025

No description provided.

@weited weited requested a review from Copilot September 8, 2025 04:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for tidal currents and EAC mooring array products to the oceancurrent file server API. The changes enable the system to handle new product types with specific directory structures and file patterns.

  • Adds configuration for three new product types: tidalCurrents-spd, tidalCurrents-sl, and EACMooringArray
  • Updates region extraction logic to handle new suffix patterns (_spd, _hv)
  • Enhances test coverage with comprehensive test cases for the new products
  • Improves test reliability by implementing order-independent JSON comparison

Reviewed Changes

Copilot reviewed 3 out of 15 changed files in this pull request and generated 3 comments.

File Description
oceancurrent_file_server_api.py Adds new product configurations and region extraction logic for tidal currents and EAC mooring
test_oceancurrent_file_server_api.py Adds test cases for new products and improves JSON comparison methodology
test_argo_oceancurrent.py Adds sorting for consistent test comparison

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

# Use local test data if DEV_MODE environment variable is set
base_path = "/mnt/oceancurrent/website/"
if os.getenv("DEV_MODE") == "true":
OCEAN_CURRENT_FILE_ROOT_PATH = f"./ARGO/oceancurrent/tests{base_path}"
Copy link

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DEV_MODE feature introduces a hardcoded relative path that may not work reliably across different execution contexts. Consider using an absolute path or making the test data location configurable through an environment variable to improve maintainability.

Suggested change
OCEAN_CURRENT_FILE_ROOT_PATH = f"./ARGO/oceancurrent/tests{base_path}"
test_data_path = os.getenv("OCEAN_CURRENT_TEST_DATA_PATH")
if test_data_path:
OCEAN_CURRENT_FILE_ROOT_PATH = os.path.join(test_data_path, base_path.lstrip("/"))
else:
# Use absolute path relative to this file for test data
OCEAN_CURRENT_FILE_ROOT_PATH = str((Path(__file__).parent / "tests" / base_path.lstrip("/")).resolve())

Copilot uses AI. Check for mistakes.
@weited weited force-pushed the feature/7399-add-tidal-currents-and-eac-mooring-for-oceancurrent branch from 1752373 to 84116ea Compare September 8, 2025 04:29
Copy link
Contributor

@shaunahu shaunahu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shaunahu shaunahu merged commit 806dfe1 into master Sep 8, 2025
0 of 2 checks passed
@shaunahu shaunahu deleted the feature/7399-add-tidal-currents-and-eac-mooring-for-oceancurrent branch September 8, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants