Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

[MOF] Begin formal JSON schema #47

Merged
merged 20 commits into from
Mar 16, 2019
Merged

[MOF] Begin formal JSON schema #47

merged 20 commits into from
Mar 16, 2019

Conversation

odow
Copy link
Owner

@odow odow commented Feb 27, 2019

Still todo

  • is there a way to validate variable names used in functions are defined in variables? Don't think so
  • nonlinear functions
  • variable and constraint attributes other than Name
  • rebase on Refactor some MOF fields #49 once merged

Closes #46

Copy link
Collaborator

@mlubin mlubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. It's even easier to read than I expected.

src/MOF/mof.schema.json Outdated Show resolved Hide resolved
@odow
Copy link
Owner Author

odow commented Feb 28, 2019

Yes, it's very easy to read. I wonder if we should include the math descriptions for all functions and sets in the schema so that it is virtually self-documenting.

@@ -0,0 +1,34 @@
{
"description": "The problem: min{x^2 + x * y + y^2}",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on

{
     "coefficient": 2,
     "variable_1": "x",
     "variable_2": "y"
 }

it should be min{x^2 + 2 * x * y + y^2}, right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. You're right that there is a mistake but that is the wrong one. I doubled the wrong value.

This is an annoying point that has come up a few times (e.g., JuliaOpt/LinQuadOptInterface.jl#22).

MOI defines the ScalarQuadraticFunction as 0.5 x' Q x.

@odow
Copy link
Owner Author

odow commented Mar 16, 2019

Merging since I think we're fairly happy with this. We can address any other points in future PR's.

@odow odow merged commit 21824c6 into master Mar 16, 2019
@odow odow deleted the od/schema branch March 16, 2019 19:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants