Update script_for_automation.py
Browse files- script_for_automation.py +8 -2
script_for_automation.py
CHANGED
|
@@ -432,8 +432,6 @@ def generate_markdown_output(df):
|
|
| 432 |
markdown += f"**Machine Generated YAML**:\n```yaml\n{machine}\n```\n"
|
| 433 |
|
| 434 |
return markdown
|
| 435 |
-
|
| 436 |
-
return markdown
|
| 437 |
|
| 438 |
|
| 439 |
def drive_process():
|
|
@@ -497,6 +495,8 @@ def drive_process():
|
|
| 497 |
gold_standard_interactions_json = json.loads(gold_standard_json["interactions"])
|
| 498 |
gold_standard_trials_json = json.loads(gold_standard_json["trials"])
|
| 499 |
|
|
|
|
|
|
|
| 500 |
|
| 501 |
print("PROCESSING SPECIFICATIONS!!!!!!!!!!!!!!!")
|
| 502 |
processed_farm_activity_json, processed_interactions_json, processed_trials_json = process_specifications(proc_spec)
|
|
@@ -509,12 +509,18 @@ def drive_process():
|
|
| 509 |
processed_farm_activity_json = json.loads(processed_farm_activity_json)
|
| 510 |
processed_interactions_json = json.loads(processed_interactions_json)
|
| 511 |
processed_trials_json = json.loads(processed_trials_json)
|
|
|
|
|
|
|
|
|
|
| 512 |
|
| 513 |
# Compare the generated JSON to the gold standard
|
| 514 |
differences_planting = list(diff(gold_standard_planting_json, processed_farm_activity_json))
|
| 515 |
differences_interactions = list(diff(gold_standard_interactions_json, processed_interactions_json))
|
| 516 |
differences_trials = list(diff(gold_standard_trials_json, processed_trials_json))
|
| 517 |
|
|
|
|
|
|
|
|
|
|
| 518 |
# Convert to yaml
|
| 519 |
completed_gold_standard_planting_json = sanitize_json_for_yaml(gold_standard_planting_json)
|
| 520 |
completed_gold_standard_interactions_json = sanitize_json_for_yaml(gold_standard_interactions_json)
|
|
|
|
| 432 |
markdown += f"**Machine Generated YAML**:\n```yaml\n{machine}\n```\n"
|
| 433 |
|
| 434 |
return markdown
|
|
|
|
|
|
|
| 435 |
|
| 436 |
|
| 437 |
def drive_process():
|
|
|
|
| 495 |
gold_standard_interactions_json = json.loads(gold_standard_json["interactions"])
|
| 496 |
gold_standard_trials_json = json.loads(gold_standard_json["trials"])
|
| 497 |
|
| 498 |
+
print("Gold standard json after loading")
|
| 499 |
+
print(gold_standard_planting_json)
|
| 500 |
|
| 501 |
print("PROCESSING SPECIFICATIONS!!!!!!!!!!!!!!!")
|
| 502 |
processed_farm_activity_json, processed_interactions_json, processed_trials_json = process_specifications(proc_spec)
|
|
|
|
| 509 |
processed_farm_activity_json = json.loads(processed_farm_activity_json)
|
| 510 |
processed_interactions_json = json.loads(processed_interactions_json)
|
| 511 |
processed_trials_json = json.loads(processed_trials_json)
|
| 512 |
+
|
| 513 |
+
print("Processed and loaded 1st json from machine gen")
|
| 514 |
+
print(processed_farm_activity_json)
|
| 515 |
|
| 516 |
# Compare the generated JSON to the gold standard
|
| 517 |
differences_planting = list(diff(gold_standard_planting_json, processed_farm_activity_json))
|
| 518 |
differences_interactions = list(diff(gold_standard_interactions_json, processed_interactions_json))
|
| 519 |
differences_trials = list(diff(gold_standard_trials_json, processed_trials_json))
|
| 520 |
|
| 521 |
+
print("Diff planting")
|
| 522 |
+
print(differences_planting)
|
| 523 |
+
|
| 524 |
# Convert to yaml
|
| 525 |
completed_gold_standard_planting_json = sanitize_json_for_yaml(gold_standard_planting_json)
|
| 526 |
completed_gold_standard_interactions_json = sanitize_json_for_yaml(gold_standard_interactions_json)
|