Skip to content

Conversation

@shuds13
Copy link
Member

@shuds13 shuds13 commented Aug 5, 2025

All fields use classes - with all having a datatype specifiable. Defaults to None.

Targets #40. More complete resolution to #39

Currently takes string for datatype (can add tuple).

  • General issue that when constants and objectives become a class then they need an attribute for what was previously the direct storage of that field.
    • This is breaking as it is
    • We could use magic methods to continue to make direct use of the object refer to that attribute (but possible confusion).
  • E.g., Objective class - added direction attribute:
    assert vocs.objectives["f"] == "MINIMIZE"
    assert vocs.constants["alpha"] == 1.0

to

    assert vocs.objectives["f"].direction == "MINIMIZE"
    assert vocs.constants["alpha"].value == 1.0

Update: Objectives now use inherited classes.

assert isinstance(vocs.objectives["f"], MinimizeObjective)
  • Should dtype be string/tuple (numpy centric) or separate type, size fields?

    • Maybe latter more intuitive if a generators validate_vocs limits values to scalars.
  • Should we constrain types for variables for instance - somehow?

  • Can we have a ContinuousVariable of integer type or should we have separate IntegerVariable as before.

  • If we do like this, we could make constraints just observables with an optional constraint attribute.

@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5de4498) to head (91c571a).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main       #45    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            5         5            
  Lines          458       563   +105     
==========================================
+ Hits           458       563   +105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shuds13
Copy link
Member Author

shuds13 commented Aug 6, 2025

From meeting:

  • Implement Objective types with inheritance - like constraints.

  • hold off on arrays

  • object.value changes - consider where/how vocs is processed.

@shuds13 shuds13 force-pushed the experimental/all_fields_are_classes branch from f02e28d to 5171859 Compare August 19, 2025 15:20
@shuds13 shuds13 marked this pull request as ready for review August 19, 2025 15:42
@shuds13 shuds13 changed the base branch from obs_type to main August 19, 2025 15:43
@shuds13 shuds13 merged commit 65093e1 into main Aug 19, 2025
7 checks passed
@shuds13 shuds13 deleted the experimental/all_fields_are_classes branch August 19, 2025 15:45
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.

3 participants