petal-user-journey-coordinator 0.1.7__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/PKG-INFO +1 -1
  2. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/pyproject.toml +1 -1
  3. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/src/petal_user_journey_coordinator/plugin.py +23 -2
  4. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/README.md +0 -0
  5. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/src/petal_user_journey_coordinator/__init__.py +0 -0
  6. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/src/petal_user_journey_coordinator/controllers.py +0 -0
  7. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/src/petal_user_journey_coordinator/data_model.py +0 -0
  8. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/__init__.py +0 -0
  9. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/dummy_trajectory_test.py +0 -0
  10. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/fix_expected_results.py +0 -0
  11. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/generate_trajectory_test_data.py +0 -0
  12. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/generated_trajectory_test_data.json +0 -0
  13. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/test_generated_trajectories.py +0 -0
  14. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/test_petal_user_journey_coordinator.py +0 -0
  15. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/test_plotting.py +0 -0
  16. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/test_trajectory_simple.py +0 -0
  17. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/test_trajectory_verification.py +0 -0
  18. {petal_user_journey_coordinator-0.1.7 → petal_user_journey_coordinator-0.1.8}/tests/trajectory_test_data.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: petal-user-journey-coordinator
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: A petal for the DroneLeaf ecosystem
5
5
  Author-Email: Khalil Al Handawi <khalil.alhandawi@droneleaf.io>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "petal-user-journey-coordinator"
3
- version = "0.1.7"
3
+ version = "0.1.8"
4
4
  description = "A petal for the DroneLeaf ecosystem"
5
5
  authors = [
6
6
  { name = "Khalil Al Handawi", email = "khalil.alhandawi@droneleaf.io" },
@@ -1711,7 +1711,18 @@ class PetalUserJourneyCoordinator(Petal):
1711
1711
  results[pname] = confirmed[pname]
1712
1712
  # check that the set value matches the requested value
1713
1713
  confirmed_value = results[pname].get("value")
1714
- if confirmed_value == parameter.parameter_value:
1714
+ requested_value = parameter.parameter_value
1715
+
1716
+ # Check for equality, handling floating point precision issues
1717
+ is_match = False
1718
+ if isinstance(confirmed_value, (float, int)) and isinstance(requested_value, (float, int)):
1719
+ # Use 1e-5 relative tolerance to handle float32/float64 mismatch
1720
+ # This should be enough for values like 0.2 vs 0.20000000298...
1721
+ is_match = math.isclose(confirmed_value, requested_value, rel_tol=1e-5)
1722
+ else:
1723
+ is_match = confirmed_value == requested_value
1724
+
1725
+ if is_match:
1715
1726
  results[pname]["success"] = True
1716
1727
  else:
1717
1728
  results[pname]["success"] = False
@@ -2589,7 +2600,17 @@ class PetalUserJourneyCoordinator(Petal):
2589
2600
  results[pname] = confirmed[pname]
2590
2601
  # check that the set value matches the requested value
2591
2602
  confirmed_value = results[pname].get("value")
2592
- if confirmed_value == parameter.parameter_value:
2603
+ requested_value = parameter.parameter_value
2604
+
2605
+ # Check for equality, handling floating point precision issues
2606
+ is_match = False
2607
+ if isinstance(confirmed_value, (float, int)) and isinstance(requested_value, (float, int)):
2608
+ # Use 1e-5 relative tolerance to handle float32/float64 mismatch
2609
+ is_match = math.isclose(confirmed_value, requested_value, rel_tol=1e-5)
2610
+ else:
2611
+ is_match = confirmed_value == requested_value
2612
+
2613
+ if is_match:
2593
2614
  results[pname]["success"] = True
2594
2615
  else:
2595
2616
  results[pname]["success"] = False