-
Notifications
You must be signed in to change notification settings - Fork 124
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
Error with any ADMA related notebook execution. Why is it looking for harvest data? #165
Comments
Hi Chetan, Thank you for testing this. I apologize for the challenges you're facing in getting this done. Let me try to explain the integration between
With regard to the HeatMap notebooks, Regarding the indexes, this notebook might be helpful. Currently, the spectral_indices notebook support all the indexes from the Awesome Indexes project. We also going to update our documentation to make the FarmVibes.AI ADMA relationship more clear. Thanks again to pointing this. Best Regards |
I spent almost entire day today to work through the example. The reason API was giving empty response was because of the fields Now, I am finally getting this error. {'admag_seasonal_field': RunDetails(start_time=datetime.datetime(2024, 5, 3, 18, 30, 2, 835748), submission_time=datetime.datetime(2024, 5, 3, 18, 30, 2, 800030), end_time=datetime.datetime(2024, 5, 3, 18, 30, 23, 756600), reason="RuntimeError: Failed to run op admag_seasonal_field in workflow run id a1b91888-5fb2-4184-8a9a-a9826b55448c for input with message id 00-a1b918885fb241848a9aa9826b55448c-32524ba44fd33432-01. Error description: <class 'RuntimeError'>: ValueError(\nValueError: Harvest does not have gfsrt property. Please check harvest properties with id=35d21af2-4934-4324-a688-4d92a7ca0024 in Admag. havest['properties']['gfsrt'] = True, means the crop is grain.\n.", status=<RunStatus.failed: 'failed'>, subtasks=[{'start_time': '2024-05-03T18:30:02.835748', 'submission_time': '2024-05-03T18:30:02.800030', 'end_time': '2024-05-03T18:30:23.756443', 'reason': "RuntimeError: Failed to run op admag_seasonal_field in workflow run id a1b91888-5fb2-4184-8a9a-a9826b55448c for input with message id 00-a1b918885fb241848a9aa9826b55448c-32524ba44fd33432-01. Error description: <class 'RuntimeError'>: ValueError(\nValueError: Harvest does not have gfsrt property. Please check harvest properties with id=35d21af2-4934-4324-a688-4d92a7ca0024 in Admag. havest['properties']['gfsrt'] = True, means the crop is grain.\n.", 'status': 'failed', 'subtasks': None}])} I can provide the script that I am using, but it would be great if you could share some data-generation scripts that can generate all data that would satisfy all the needs of the system. Otherwise, I'm ready to hang-up my boots and may be pick-up in future when there are more details around this.
Thanks for reference to these notebooks, I can definitely work with these: -
P.S - I am attaching here data generation script. Would appreciate if you can share yours. Best Regards, |
Hi @chetan2309, Thanks a lot for providing the code. I am sorry that you had to spend such a long time on this. I believe some examples from the ADMA data we have might be useful in resolving the issue you're currently facing. Seasonal Field
{'farmId': '0861e6b5-88a9-4021-b94e-c4e9d6094b80-18', 'fieldId': '04b1d9f6-7444-4df5', 'name': 'Alfalfa', 'description': 'annual', 'status': 'Active', 'seasonId': '333a7fcd-641a-4110', 'cropId': '09c27f6f-1478-4720', 'cropVarietyIds': None, 'avgYieldValue': None, 'avgYieldUnit': None, 'avgSeedPopulationValue': None, 'avgSeedPopulationUnit': None, 'properties': None, 'geometry': {'type': 'MultiPolygon', 'coordinates': []}}
Harvest
{'source': 'baseline', 'name': None, 'description': None, 'status': 'Active', 'operationStartDateTime': '2000/09/05', 'operationEndDateTime': '2000/09/05', 'totalYield': {'unit': 'tons', 'value': 39}, 'operationModifiedDateTime': None, 'area': None, 'avgYield': None, 'totalWetMass': None, 'avgWetMass': None, 'avgMoisture': None, 'avgSpeed': None, 'harvestProductDetails': None, 'properties': {'gfsrt': 'True', 'strawStoverHayRemoval': '0'}, 'geometry': {'type': 'MultiPolygon', 'coordinates': []}, 'associatedResource': {'type': 'SeasonalField', 'id': 'fe5cc763-3a1e-4017'}}
Tillage
{'source': 'baseline', 'name': 'Reduced Tillage', 'description': None, 'status': 'Active', 'operationStartDateTime': '2000/01/01', 'operationEndDateTime': '2000/01/01', 'operationModifiedDateTime': None, 'tillageDepth': None, 'tillagePressure': None, 'area': None, 'properties': None, 'geometry': {'type': 'MultiPolygon', 'coordinates': []}, 'associatedResource': {'type': 'SeasonalField', 'id': 'fe5cc763-3a1e-4017'}}
Fertilizers
{'source': 'baseline', 'operationStartDateTime': '2000/01/01', 'operationEndDateTime': '2000/01/01', 'totalMaterial': {'unit': 'tons/ac', 'value': 5.0}, 'name': 'Ammonium Nitrate (34-0-0)', 'properties': {'eep': 'None', 'totalNitrogen': 4.0, 'method': 'Surface Band / Sidedress'}, 'geometry': {'type': 'MultiPolygon', 'coordinates': []}, 'associatedResource': {'type': 'SeasonalField', 'id': 'fe5cc763-3a1e-4017'}}
OMAD - Organic Amendments
{'source': 'baseline', 'operationStartDateTime': '2000/03/01', 'operationEndDateTime': '2000/03/01', 'totalMaterial': {'unit': 'tons/ac', 'value': 10.0}, 'name': None, 'properties': {'date': '2000/03/01', 'type': 'Beef Manure, Solid', 'amount': 10.0, 'percentN': 0.6, 'CNratio': 1.2}, 'geometry': {'type': 'MultiPolygon', 'coordinates': []}, 'associatedResource': {'type': 'SeasonalField', 'id': 'fe5cc763-3a1e-4017'}} Just make sure to replace the geometry coordinates and ids with your actual values (The ids here are fake). Please, let me know if this works for you. Att |
@brsilvarec - thanks for your reply, I will try with this data tomorrow. However, since one of the primary use case w.r.t ADMA integration is to be able to see certain indices in advance at field level I am afraid this may not be the right workflow or may be develop a custom workflow with custom needs? W.r.t spectral indices notebook - Since we are going to consume these generated indices as PNG/TIFF/JPEG files in our application to show users with calculated indices, do we have any custom workflows that can save these indices back to customer's blob storage? There are 2 approaches I could think of:-
Could you let me know which approach will work best along with any examples? Regards, |
@brsilvarec - there still seems to be error in the data.
I am getting below error - Any clue how the code is constructing field_info data? I am unable to find this in farmvibes code repo. Please help {'admag_seasonal_field': RunDetails(start_time=datetime.datetime(2024, 5, 7, 8, 21, 15, 810632), submission_time=datetime.datetime(2024, 5, 7, 8, 21, 15, 589626), end_time=datetime.datetime(2024, 5, 7, 8, 21, 36, 325985), reason='RuntimeError: Failed to run op admag_seasonal_field in workflow run id 1f5ca14c-87c2-4927-8741-4c47e4bc86b2 for input with message id 00-1f5ca14c87c2492787414c47e4bc86b2-2a7ea9c2f2c91b1a-01. Error description: <class 'RuntimeError'>: Traceback (most recent call last):\n File "/opt/conda/lib/python3.11/site-packages/vibe_agent/worker.py", line 142, in run_op\n return factory.build(spec).run(input, cache_info)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/opt/conda/lib/python3.11/site-packages/vibe_agent/ops.py", line 106, in run\n stac_results = self._call_validate_op(**items)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/opt/conda/lib/python3.11/site-packages/vibe_agent/ops.py", line 72, in _call_validate_op\n results = self.callback(**kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^\n File "/app/ops/admag/admag_seasonal_field_op.py", line 309, in get_admag_seasonal_field\n seasonal_field = self.get_season_field_data(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/app/ops/admag/admag_seasonal_field_op.py", line 301, in get_season_field_data\n properties=field_info["properties"],\n ~~~~~~~~~~^^^^^^^^^^^^^^\nKeyError: 'properties'\n.', status=<RunStatus.failed: 'failed'>, subtasks=[{'start_time': '2024-05-07T08:21:15.810632', 'submission_time': '2024-05-07T08:21:15.589626', 'end_time': '2024-05-07T08:21:36.325799', 'reason': 'RuntimeError: Failed to run op admag_seasonal_field in workflow run id 1f5ca14c-87c2-4927-8741-4c47e4bc86b2 for input with message id 00-1f5ca14c87c2492787414c47e4bc86b2-2a7ea9c2f2c91b1a-01. Error description: <class 'RuntimeError'>: Traceback (most recent call last):\n File "/opt/conda/lib/python3.11/site-packages/vibe_agent/worker.py", line 142, in run_op\n return factory.build(spec).run(input, cache_info)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/opt/conda/lib/python3.11/site-packages/vibe_agent/ops.py", line 106, in run\n stac_results = self._call_validate_op(**items)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/opt/conda/lib/python3.11/site-packages/vibe_agent/ops.py", line 72, in _call_validate_op\n results = self.callback(**kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^\n File "/app/ops/admag/admag_seasonal_field_op.py", line 309, in get_admag_seasonal_field\n seasonal_field = self.get_season_field_data(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/app/ops/admag/admag_seasonal_field_op.py", line 301, in get_season_field_data\n properties=field_info["properties"],\n ~~~~~~~~~~^^^^^^^^^^^^^^\nKeyError: 'properties'\n.', 'status': 'failed', 'subtasks': None}])} |
Thanks @chetan2309 for checking on this. I still see this attributes cropVarietyIds, avgYieldValue, avgYieldUnit avgSeedPopulationValue, avgSeedPopulationUnit in the document of Seasonal field. Which ADMAG version you're using? See below url for the document we are using. For the issue you're seeing with workflow, can you check the field object inserted in ADMAG with json shared below. Also, in the json shared for seasonal field, I see planting date is mapped with seasonal field. In new version, planting has separate resource and it's mapped with seasonal field. Please see below json and make changes accordingly. |
I am using latest version of ADMA 2023-11-01-preview, the version link you mentioned here is extremely dated. Please share your findings w.r.t latest version, for some operational reasons as we are on 2023-11-01-preview it will be impossible for us to use any prior version. Seasonal fields latest version - is what I am using. REgards, |
Sorry for the confusion. It's version "2023-11-01-preview" we have upgraded recently. I shared the wrong url. These fields cropVarietyIds, avgYieldValue, avgYieldUnit avgSeedPopulationValue, avgSeedPopulationUnit are removed in recent upgrade, I see that. You can ignore them. It still exists in data load scripts we are using internally. Will check and confirm you back if these fields causing the workflow to fail. |
Still, little bit of confusion. If you see my point no 2 above where I mentioned that I removed these fields to make workflow proceed forward but now I am blocked on - File "/app/ops/admag/admag_seasonal_field_op.py", line 301, in get_season_field_data\n properties=field_info["properties"],\n ~~~~~~~~~~^^^^^^^^^^^^^^\nKeyError: 'properties'\n.', Can you please check this code on your end to help identify the error? Because you can see payload that I have provided above. It clearly has properties field although in the example provided by your team it was null. Tried with null also, still same error. |
The error you're seeing due to missing properties in Field. Can you check if field object having properties? Field |
What exact fields is it looking for, if it is only looking for the Key -> "Properties" then I have. Because, as I understand you can put anything in properties bag? Right? I think my concern is also that error message is not descriptive enough. def create_field(farm_id, field_id):
# Step 3: Create a field.
print(f"Creating or updating field with Id {field_id}...", end=" ", flush=True)
url = base_url + f"parties/{party_id}/fields/{field_id}" + "?" + api_version
payload = json.dumps(
{
"farmId": farm_id,
"status": "Active",
"name": "John Smith's Field",
"description": "This is an awesome John's field",
"source": "Data ingestion",
"properties": {
"Irrigated": "Yes",
"RetailerId": "Retailer123"
}
}
)
print(url)
print (make_request(url, payload).text) |
It's strange. It's just looking for key "properties". Can you share me what information you're getting if you do get on field_id you're inserting? |
@chetan2309 and @csharma2309, any updates here? |
Closing this issue for now. Feel free to reopen. |
Topic
Notebook
Ask away!
Hi Team,
I am running ADMA related notebooks; I actually ran two of the notebooks: -
Both notebooks are encountering a similar sort of error "No harvest found with parameters: ". It seems like that underlying ADMA's Harvest API is returning zero results.
However at the same time, A Few observations/questions that I have:-
P.S. - Is there any write up that I can read to solidify my understanding? I come from an application development background with some domain knowledge.
Regards,
Chetan
The text was updated successfully, but these errors were encountered: