-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/ant 1267 #22
Feature/ant 1267 #22
Conversation
master: OptimizationProblem, | ||
subproblems: List[OptimizationProblem], | ||
emplacement: str = "outputs/lp", | ||
output_path: str = "output/xpansion", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outputs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That depends on what tree you would like. For now it is like this:
outputs/
└── lp
├── master.mps
├── options.json
├── structure.txt
├── subproblem_1.mps
├── subproblem_2.mps
└── output
│ └── xpansion
│ ├── last_iteration.json
│ └── out.json
So output is inside outputs, but we could change it if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know if it is best to replicate the actual Xpansion tree or if it does not matter. The actual tree is :
outputs/
└── lp
├── master.mps
├── options.json
├── structure.txt
├── subproblem_1.mps
├── subproblem_2.mps
├── expansion
│ ├── last_iteration.json
│ └── out.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ‘expansion’ dir is at same level as lp ❤️
self.read_solution() | ||
return True | ||
else: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raise an error message ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. For now I would leave like this and would raise an error in the PR with the CI integration
return self.data["solution"]["problem_status"] | ||
|
||
@property | ||
def optimality_gap(self) -> float: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename function to absolute_gap
(closer to the mathematical meaning of the data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor technical stuff to fix before merge (class-level field on non-dataclass)
src/andromede/simulation/runner.py
Outdated
|
||
|
||
class CommandRunner: | ||
current_dir: pathlib.Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not a dataclass
, those class-level fields are not used --> they must be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will change it, but as I said here, if they don't have default values, they are just annotations and not actuel class-fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed your previous comment, I've been wrong the whole time :)
My python knowledge is not up to date ! Thanks for sharing the reference.
|
||
@dataclass(frozen=True) | ||
class BendersSolution: | ||
data: Dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we could use pydantic
to perform parsing + validation of the JSON content, while having a more typed class (with usual named fields etc).
Can be a future improvement, it's an implementation detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that, I will have a look later :)
4c40951
to
e500cdb
Compare
No description provided.