Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Endpoint to retrieve min/max values for criteria ranges #62

Merged
merged 4 commits into from
May 7, 2025

Conversation

ConnectedSystems
Copy link
Collaborator

Endpoint: /criteria/ranges

Example return:

{
  "Depth": {
    "min_val": -19.75835,
    "max_val": -0.09198824
  },
  "Benthic": {
    "min_val": 13,
    "max_val": 15
  },
  "Geomorphic": {
    "min_val": 21,
    "max_val": 24
  },
  "Slope": {
    "min_val": 0.012136885,
    "max_val": 48.634396
  },
  "Turbidity": {
    "min_val": 1,
    "max_val": 454
  },
  "WavesHs": {
    "min_val": 0.2369229,
    "max_val": 2.5359628
  },
  "WavesTp": {
    "min_val": 1.9433917,
    "max_val": 9.299267
  },
  "Rugosity": {
    "min_val": 0.1420705,
    "max_val": 9.601867
  }
}

This PR has changes that were more focused on tidying things up, moving code around and adding docstrings, so it ended up not being so nice, neat, and tidy. Sorry folks, not what I usually do.

@arlowhite Not sure what to do on the frontend with values like 2.53 - use a value rounded up to nearest whole number?

Data for reef flats are currently unused but rather than define a whole other subtype for a single habitat data store, I simply use the first row to mock up an entry (that is never used or accessed).
Maintain conceptual similarity between code/implementations.

Caches criteria ranges on initial cache warm up
Specific method (assessment of candidate rotated towards the reef edge) is currently unused, but may be useful later so not removing just yet.
@ConnectedSystems ConnectedSystems linked an issue May 6, 2025 that may be closed by this pull request
Copy link
Collaborator

@PeterBaker0 PeterBaker0 left a comment

Choose a reason for hiding this comment

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

Looks good - hard to review thoroughly without actually testing it out/but have scanned through highlighted areas. Thanks for the inline comments and doc strings.

@ConnectedSystems ConnectedSystems merged commit 1090632 into main May 7, 2025
1 check passed
@ConnectedSystems ConnectedSystems deleted the feat/criteria-ranges branch May 7, 2025 07:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement endpoint to return criteria ranges
2 participants