-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: soil id endpoints #1273
Conversation
"""A soil match based solely on a coordinate pair.""" | ||
type LocationBasedSoilMatch { | ||
dataSource: String! | ||
inMapUnit: Boolean! |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
||
def test_location_based_soil_matches_endpoint(client): | ||
response = graphql_query( | ||
LOCATION_BASED_MATCHES_QUERY, variables={"latitude": 0.0, "longitude": 0.0}, client=client |
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
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!
There was a problem hiding this 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
@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:
|
@@ -118,15 +116,19 @@ class DataBasedSoilMatches(graphene.ObjectType): | |||
matches = graphene.List(graphene.NonNull(DataBasedSoilMatch), required=True) | |||
|
|||
|
|||
class LabColorInput(graphene.InputObjectType): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, it's just LAB 🤷 https://en.wikipedia.org/wiki/CIELAB_color_space
There was a problem hiding this comment.
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.
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
Related Issues
Progress on #1265 and #1266