Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: soil id endpoints #1273

Merged
merged 8 commits into from
May 14, 2024
Merged

feat: soil id endpoints #1273

merged 8 commits into from
May 14, 2024

Conversation

shrouxm
Copy link
Member

@shrouxm shrouxm commented May 2, 2024

Description

Defines GraphQL endpoints for the soil id calls, with dummy data for now. Still need to add tests to validate that the endpoints work/return data with the right shape.

Checklist

  • Corresponding issue has been opened
  • New tests added

Related Issues

Progress on #1265 and #1266

@shrouxm shrouxm requested review from knipec and tm-ruxandra May 2, 2024 17:37
@shrouxm shrouxm marked this pull request as draft May 2, 2024 22:00
@shrouxm shrouxm marked this pull request as ready for review May 8, 2024 22:29
@shrouxm shrouxm requested review from knipec and tm-ruxandra May 8, 2024 22:29
"""A soil match based solely on a coordinate pair."""
type LocationBasedSoilMatch {
dataSource: String!
inMapUnit: Boolean!
Copy link
Contributor

Choose a reason for hiding this comment

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

Question (non-blocking for this PR though!): I wasn't entirely clear if this was a boolean or an enum when Courtney mentioned it. Is it just "in soil map unit" or "near soil map unit", and if your location is deemed too far away then it would be one of the "no map data" cases (at least post-Capri)?

(Please validate this stream of consciousness lol: I was at first like "what should we show in Capri here if it's a 'no map data' case" -- but actually that's not applicable because you can only to the screen that displays that info if you have a non-empty set of soil matches, which requires there being map data ... I think?)

Copy link
Member Author

Choose a reason for hiding this comment

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

i don't fully understand this either, it's on my todo list to look into this a bit more carefully. @CourtneyLee333 could you expand on the intention/source of the requirement for the "In map unit" text in the figma?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the last issue I see with this API, so once this gets squared away I think we're good to merge.

@shrouxm shrouxm mentioned this pull request May 9, 2024
1 task

def test_location_based_soil_matches_endpoint(client):
response = graphql_query(
LOCATION_BASED_MATCHES_QUERY, variables={"latitude": 0.0, "longitude": 0.0}, client=client
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Would this fail once we have actual data coming in? I don't think there's soil at null island? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

i think you're right 🤔 https://www.openstreetmap.org/#map=10/0.0000/0.0000

& yes, this will get updated to real coordinates when there's real data!

Copy link
Contributor

@knipec knipec left a comment

Choose a reason for hiding this comment

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

I'm down for you to merge this and sort out the inMapUnit stuff in a follow-up PR

@shrouxm
Copy link
Member Author

shrouxm commented May 13, 2024

@knipec i just pushed one more change, incorporating the map unit distance changed we talked about in stand-up, and i also changed the format of the color inputs we were talking about earlier in the review based on my attempts at wiring this up to the actual algorithm:

  • it turns out the lowest friction thing will be to return the munsell color string as is from the algorithm,
  • and the algorithm expects color to be input to it in Lab format, which we already functions for converting to munsell on the frontend

@@ -118,15 +116,19 @@ class DataBasedSoilMatches(graphene.ObjectType):
matches = graphene.List(graphene.NonNull(DataBasedSoilMatch), required=True)


class LabColorInput(graphene.InputObjectType):
Copy link
Contributor

@knipec knipec May 13, 2024

Choose a reason for hiding this comment

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

Suggestion: Does "Lab" stand for something? If so, maybe make a comment or name L, a, and b more clearly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

suggestion: call this LABColorInput, since we capitalized RGB elsewhere.

@shrouxm shrouxm merged commit fe4cbf8 into main May 14, 2024
7 checks passed
@shrouxm shrouxm deleted the feat/soil-id-endpoints branch May 14, 2024 16:30
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.

4 participants