Issue 20773: MixedIntegerLinearProgram.new_variable could optionally take a "static" list of component indices
archive/issues_020536.json:
{
"assignees": [],
"body": "<div id=\"comment:0\"></div>\n\nCurrently, `new_variable` allocates backend indices to MIP variable component indices very dynamically.\n\n```\nsage: p = MixedIntegerLinearProgram()\nsage: x = p.new_variable()\nsage: x[7]\nx_0\nsage: x[2]\nx_1\n```\n\nSometimes it could be nice to have a predictable order in the backend; for example, when `.polyhedron()` is to be called. And sometimes it could be nice to declare ahead of time which component indices are valid, making accesses to other indices an error (rather than creating a new backend variable); this could help debug MIP models.\n\nThis could look like this:\n\n```\nsage: p = MixedIntegerLinearProgram()\nsage: x = p.new_variable(indices=range(7))\nsage: p.number_of_variables()\n7\nsage: x[3]\nx_3\nsage: x[11]\nIndexError: 11 does not index a component of MIPVariable of dimension 1\n```\n(This is optional; if no `indices` argument is passed, it keeps the fully dynamic current behavior.)\n\n\nCC: @dimpase @videlec @jdemeyer @nbruin @fchapoton @sagetrac-tmonteil @dcoudert @tscrim\n\nComponent: **numerical**\n\nAuthor: **Matthias Koeppe**\n\nBranch/Commit: **[`23689dd`](https://github.com/sagemath/sagetrac-mirror/commit/23689ddb190d6e2847fd492c91c996a7afa2bbea)**\n\nReviewer: **Travis Scrimshaw**\n\n_Issue created by migration from https://trac.sagemath.org/ticket/20773_\n\n",
"closed_at": "2018-09-21T22:20:38Z",
"created_at": "2016-06-03T16:19:03Z",
"labels": [
"https://github.com/sagemath/sage/labels/c%3A%20numerical",
"https://github.com/sagemath/sage/labels/p%3A%20major%20/%203",
"https://github.com/sagemath/sage/labels/enhancement",
"https://github.com/sagemath/sage/labels/c%3A%20linear%20programming"
],
"milestone": "https://github.com/sagemath/sage/milestones/sage-8.4",
"reactions": [],
"repository": "https://github.com/sagemath/sage",
"title": "MixedIntegerLinearProgram.new_variable could optionally take a \"static\" list of component indices",
"type": "issue",
"updated_at": "2018-09-21T22:20:38Z",
"url": "https://github.com/sagemath/sage/issues/20773",
"user": "https://github.com/mkoeppe"
}
Currently, new_variable
allocates backend indices to MIP variable component indices very dynamically.
sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable()
sage: x[7]
x_0
sage: x[2]
x_1
Sometimes it could be nice to have a predictable order in the backend; for example, when .polyhedron()
is to be called. And sometimes it could be nice to declare ahead of time which component indices are valid, making accesses to other indices an error (rather than creating a new backend variable); this could help debug MIP models.
This could look like this:
sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable(indices=range(7))
sage: p.number_of_variables()
7
sage: x[3]
x_3
sage: x[11]
IndexError: 11 does not index a component of MIPVariable of dimension 1
(This is optional; if no indices
argument is passed, it keeps the fully dynamic current behavior.)
CC: @dimpase @videlec @jdemeyer @nbruin @fchapoton @sagetrac-tmonteil @dcoudert @tscrim
Component: numerical
Author: Matthias Koeppe
Branch/Commit: 23689dd
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/20773
archive/issue_events_289886.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2016-06-03T16:19:03Z",
"event": "milestoned",
"issue": "https://github.com/sagemath/sage/issues/20773",
"milestone_number": null,
"milestone_title": "sage-7.3",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289886"
}
archive/issue_events_289887.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2016-06-03T16:19:03Z",
"event": "labeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/c%3A%20numerical",
"label_color": "0000ff",
"label_name": "c: numerical",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289887"
}
archive/issue_events_289888.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2016-06-03T16:19:03Z",
"event": "labeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/p%3A%20major%20/%203",
"label_color": "ffbb00",
"label_name": "p: major / 3",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289888"
}
archive/issue_events_289889.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2016-06-03T16:19:03Z",
"event": "labeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/enhancement",
"label_color": "696969",
"label_name": "enhancement",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289889"
}
archive/issue_events_289890.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2016-06-03T16:19:03Z",
"event": "labeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/c%3A%20linear%20programming",
"label_color": "0000ff",
"label_name": "c: linear programming",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289890"
}
archive/issue_comments_301238.json:
{
"body": "Branch: **[u/mkoeppe/mixedintegerlinearprogram_new_variable_could_optionally_take_a__static__list_of_component_indices](https://github.com/sagemath/sagetrac-mirror/tree/u/mkoeppe/mixedintegerlinearprogram_new_variable_could_optionally_take_a__static__list_of_component_indices)**",
"created_at": "2018-09-18T15:42:02Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301238",
"user": "https://github.com/mkoeppe"
}
archive/issue_comments_301239.json:
{
"body": "Description changed:\n``````diff\n--- \n+++ \n@@ -15,13 +15,13 @@\n \n ```\n sage: p = MixedIntegerLinearProgram()\n-sage: x = p.new_variable(components=range(7))\n+sage: x = p.new_variable(indices=range(7))\n sage: p.number_of_variables()\n 7\n sage: x[3]\n x_3\n sage: x[11]\n-IndexError: MIPVariable component index out of range\n+IndexError: 11 does not index a component of MIPVariable of dimension 1\n ```\n-(This would be optional; if no `components` argument is passed, it would match the fully dynamic current behavior.)\n+(This is optional; if no `indices` argument is passed, it keeps the fully dynamic current behavior.)\n \n``````\n",
"created_at": "2018-09-18T15:49:54Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301239",
"user": "https://github.com/mkoeppe"
}
Description changed:
---
+++
@@ -15,13 +15,13 @@
```
sage: p = MixedIntegerLinearProgram()
-sage: x = p.new_variable(components=range(7))
+sage: x = p.new_variable(indices=range(7))
sage: p.number_of_variables()
7
sage: x[3]
x_3
sage: x[11]
-IndexError: MIPVariable component index out of range
+IndexError: 11 does not index a component of MIPVariable of dimension 1
```
-(This would be optional; if no `components` argument is passed, it would match the fully dynamic current behavior.)
+(This is optional; if no `indices` argument is passed, it keeps the fully dynamic current behavior.)
archive/issue_events_289891.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2018-09-18T15:49:54Z",
"event": "demilestoned",
"issue": "https://github.com/sagemath/sage/issues/20773",
"milestone_number": null,
"milestone_title": "sage-7.3",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289891"
}
archive/issue_events_289892.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2018-09-18T15:49:54Z",
"event": "milestoned",
"issue": "https://github.com/sagemath/sage/issues/20773",
"milestone_number": null,
"milestone_title": "sage-8.4",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289892"
}
archive/issue_events_289893.json:
{
"actor": "https://github.com/mkoeppe",
"created_at": "2018-09-18T15:49:54Z",
"event": "labeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/needs%20review",
"label_color": "7fff00",
"label_name": "needs review",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289893"
}
archive/issue_comments_301240.json:
{
"body": "Commit: **[`7cb2b3a`](https://github.com/sagemath/sagetrac-mirror/commit/7cb2b3a54149fa30ea6bc2f47b50a311dca6935d)**",
"created_at": "2018-09-18T15:49:54Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301240",
"user": "https://github.com/mkoeppe"
}
Commit: 7cb2b3a
archive/issue_comments_301241.json:
{
"body": "Author: **Matthias Koeppe**",
"created_at": "2018-09-18T15:49:54Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301241",
"user": "https://github.com/mkoeppe"
}
Author: Matthias Koeppe
archive/issue_comments_301242.json:
{
"body": "<div id=\"comment:2\" align=\"right\">comment:2</div>\n\nNeeds review. Comments on the proposed interface are welcome.\n\n---\nNew commits:\n<table><tr><td><a href=\"https://github.com/sagemath/sagetrac-mirror/commit/7cb2b3a54149fa30ea6bc2f47b50a311dca6935d\"><code>7cb2b3a</code></a></td><td><code>MIPVariable, MixedIntegerLinearProgram.new_variable: Take optional static list of component indices</code></td></tr></table>\n",
"created_at": "2018-09-18T15:49:54Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301242",
"user": "https://github.com/mkoeppe"
}
Needs review. Comments on the proposed interface are welcome.
New commits:
7cb2b3a | MIPVariable, MixedIntegerLinearProgram.new_variable: Take optional static list of component indices |
archive/issue_comments_301243.json:
{
"body": "Reviewer: **Travis Scrimshaw**",
"created_at": "2018-09-18T23:15:46Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301243",
"user": "https://github.com/tscrim"
}
Reviewer: Travis Scrimshaw
archive/issue_comments_301244.json:
{
"body": "<div id=\"comment:3\" align=\"right\">comment:3</div>\n\nWhile it might be a little less verbose, it is more conceptually an optional argument if the default was `None`. Then you could also write the doc as\n\n```\n - ``indices`` -- (optional) an iterable of keys; components\n corresponding to these keys are created in order,\n and access to components with other keys will raise an\n error; otherwise components of this variable can be\n indexed by arbitrary keys and are created dynamically\n on access\n```\nHowever, I don't care strongly either way. So if you want to keep the current version, then you can set a positive review on my behalf.",
"created_at": "2018-09-18T23:15:46Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301244",
"user": "https://github.com/tscrim"
}
While it might be a little less verbose, it is more conceptually an optional argument if the default was None
. Then you could also write the doc as
- ``indices`` -- (optional) an iterable of keys; components
corresponding to these keys are created in order,
and access to components with other keys will raise an
error; otherwise components of this variable can be
indexed by arbitrary keys and are created dynamically
on access
However, I don't care strongly either way. So if you want to keep the current version, then you can set a positive review on my behalf.
archive/issue_comments_301245.json:
{
"body": "<div id=\"comment:4\" align=\"right\">comment:4</div>\n\nReplying to [@tscrim](#comment%3A3):\n> While it might be a little less verbose, it is more conceptually an optional argument if the default was `None`. \n\nRight, but I definitely want to distinguish `[]` from the default argument (and from a discussion on `Polyhedron` I remember that one developer (Volker?) seems to hold the opinion that `None` and `[]` should never (?) be distinguished by Python methods). \n\n(`indices = []` must give a static-index MIP variable for which any component access is an error.)",
"created_at": "2018-09-19T13:11:39Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301245",
"user": "https://github.com/mkoeppe"
}
Replying to @tscrim:
While it might be a little less verbose, it is more conceptually an optional argument if the default was
None
.
Right, but I definitely want to distinguish []
from the default argument (and from a discussion on Polyhedron
I remember that one developer (Volker?) seems to hold the opinion that None
and []
should never (?) be distinguished by Python methods).
(indices = []
must give a static-index MIP variable for which any component access is an error.)
archive/issue_comments_301246.json:
{
"body": "Description changed:\n``````diff\n--- \n+++ \n@@ -9,7 +9,7 @@\n x_1\n ```\n \n-Sometimes it could be nice to have a predictable order in the backend. And sometimes it could be nice to declare ahead of time which component indices are valid, making accesses to other indices an error (rather than creating a new backend variable); this could help debug MIP models.\n+Sometimes it could be nice to have a predictable order in the backend; for example, when `.polyhedron()` is to be called. And sometimes it could be nice to declare ahead of time which component indices are valid, making accesses to other indices an error (rather than creating a new backend variable); this could help debug MIP models.\n \n This could look like this:\n \n``````\n",
"created_at": "2018-09-19T13:18:32Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301246",
"user": "https://github.com/mkoeppe"
}
Description changed:
---
+++
@@ -9,7 +9,7 @@
x_1
```
-Sometimes it could be nice to have a predictable order in the backend. And sometimes it could be nice to declare ahead of time which component indices are valid, making accesses to other indices an error (rather than creating a new backend variable); this could help debug MIP models.
+Sometimes it could be nice to have a predictable order in the backend; for example, when `.polyhedron()` is to be called. And sometimes it could be nice to declare ahead of time which component indices are valid, making accesses to other indices an error (rather than creating a new backend variable); this could help debug MIP models.
This could look like this:
archive/issue_comments_301247.json:
{
"body": "<div id=\"comment:6\" align=\"right\">comment:6</div>\n\nReplying to [@mkoeppe](#comment%3A4):\n> Replying to [@tscrim](#comment%3A3):\n> > While it might be a little less verbose, it is more conceptually an optional argument if the default was `None`. \n> \n> \n> Right, but I definitely want to distinguish `[]` from the default argument (and from a discussion on `Polyhedron` I remember that one developer (Volker?) seems to hold the opinion that `None` and `[]` should never (?) be distinguished by Python methods). \n\nThat is not a good rule IMO:\n\n```\nsage: Partition([])\n[]\nsage: Partition(None) # This makes no sense and rightly raises an error.\n```\nThe only thing you have to be careful about is `if foo:` just needs to be `if foo is None:`. It seems like you having such a non-`False`-bool default value is more likely to cause issues given how Python code usually can be written, and it can mean a more arbitrary default that has less meaning for the code. It also does not mesh well with Cython either. I would be curious to hearing what the argument for this is, but I think `None` and `[]` should be considered as distinguishable. Unless you also want `False`, `()`, and `0` to not be distinguishable either? At least, that is what I think the logic of this rule leads me to conclude.",
"created_at": "2018-09-19T13:46:28Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301247",
"user": "https://github.com/tscrim"
}
Replying to @mkoeppe:
Replying to @tscrim:
While it might be a little less verbose, it is more conceptually an optional argument if the default was
None
.Right, but I definitely want to distinguish
[]
from the default argument (and from a discussion onPolyhedron
I remember that one developer (Volker?) seems to hold the opinion thatNone
and[]
should never (?) be distinguished by Python methods).
That is not a good rule IMO:
sage: Partition([])
[]
sage: Partition(None) # This makes no sense and rightly raises an error.
The only thing you have to be careful about is if foo:
just needs to be if foo is None:
. It seems like you having such a non-False
-bool default value is more likely to cause issues given how Python code usually can be written, and it can mean a more arbitrary default that has less meaning for the code. It also does not mesh well with Cython either. I would be curious to hearing what the argument for this is, but I think None
and []
should be considered as distinguishable. Unless you also want False
, ()
, and 0
to not be distinguishable either? At least, that is what I think the logic of this rule leads me to conclude.
archive/issue_comments_301248.json:
{
"body": "<div id=\"comment:7\"></div>\n\nBranch pushed to git repo; I updated commit sha1. New commits:\n<table><tr><td><a href=\"https://github.com/sagemath/sagetrac-mirror/commit/604b2c76f28df5d7b9684a2c874ee41e9de51bfd\"><code>604b2c7</code></a></td><td><code>MIPVariable, MixedIntegerLinearProgram.new_variable: Use None instead of 'dynamic'</code></td></tr></table>\n",
"created_at": "2018-09-19T13:56:49Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301248",
"user": "https://github.com/sagetrac-git"
}
Branch pushed to git repo; I updated commit sha1. New commits:
604b2c7 | MIPVariable, MixedIntegerLinearProgram.new_variable: Use None instead of 'dynamic' |
archive/issue_comments_301249.json:
{
"body": "Changed commit from **[`7cb2b3a`](https://github.com/sagemath/sagetrac-mirror/commit/7cb2b3a54149fa30ea6bc2f47b50a311dca6935d)** to **[`604b2c7`](https://github.com/sagemath/sagetrac-mirror/commit/604b2c76f28df5d7b9684a2c874ee41e9de51bfd)**",
"created_at": "2018-09-19T13:56:49Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301249",
"user": "https://github.com/sagetrac-git"
}
Changed commit from 7cb2b3a
to 604b2c7
archive/issue_comments_301250.json:
{
"body": "<div id=\"comment:8\" align=\"right\">comment:8</div>\n\nThanks for the discussion. I've changed it to `None`. Needs review",
"created_at": "2018-09-19T13:58:11Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301250",
"user": "https://github.com/mkoeppe"
}
Thanks for the discussion. I've changed it to None
. Needs review
archive/issue_comments_301251.json:
{
"body": "Changed commit from **[`604b2c7`](https://github.com/sagemath/sagetrac-mirror/commit/604b2c76f28df5d7b9684a2c874ee41e9de51bfd)** to **[`23689dd`](https://github.com/sagemath/sagetrac-mirror/commit/23689ddb190d6e2847fd492c91c996a7afa2bbea)**",
"created_at": "2018-09-20T02:09:09Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301251",
"user": "https://github.com/sagetrac-git"
}
Changed commit from 604b2c7
to 23689dd
archive/issue_comments_301252.json:
{
"body": "<div id=\"comment:9\"></div>\n\nBranch pushed to git repo; I updated commit sha1. New commits:\n<table><tr><td><a href=\"https://github.com/sagemath/sagetrac-mirror/commit/23689ddb190d6e2847fd492c91c996a7afa2bbea\"><code>23689dd</code></a></td><td><code>MIPVariable.__getitem__: Add doctest</code></td></tr></table>\n",
"created_at": "2018-09-20T02:09:09Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301252",
"user": "https://github.com/sagetrac-git"
}
Branch pushed to git repo; I updated commit sha1. New commits:
23689dd | MIPVariable.__getitem__: Add doctest |
archive/issue_comments_301253.json:
{
"body": "<div id=\"comment:10\" align=\"right\">comment:10</div>\n\nReplying to [@mkoeppe](#comment%3A4):\n> I definitely want to distinguish `[]` from the default argument ...\n> (`indices = []` must give a static-index MIP variable for which any component access is an error.)\n\nI've added a doctest for this.\n\nReady for final review",
"created_at": "2018-09-20T02:10:18Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301253",
"user": "https://github.com/mkoeppe"
}
Replying to @mkoeppe:
I definitely want to distinguish
[]
from the default argument ... (indices = []
must give a static-index MIP variable for which any component access is an error.)
I've added a doctest for this.
Ready for final review
archive/issue_events_289894.json:
{
"actor": "https://github.com/tscrim",
"created_at": "2018-09-20T02:27:07Z",
"event": "unlabeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/needs%20review",
"label_color": "7fff00",
"label_name": "needs review",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289894"
}
archive/issue_events_289895.json:
{
"actor": "https://github.com/tscrim",
"created_at": "2018-09-20T02:27:07Z",
"event": "labeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/positive%20review",
"label_color": "dfffc0",
"label_name": "positive review",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289895"
}
archive/issue_comments_301254.json:
{
"body": "<div id=\"comment:11\" align=\"right\">comment:11</div>\n\nThanks. LGTM.",
"created_at": "2018-09-20T02:27:07Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301254",
"user": "https://github.com/tscrim"
}
Thanks. LGTM.
archive/issue_comments_301255.json:
{
"body": "Changed branch from **[u/mkoeppe/mixedintegerlinearprogram_new_variable_could_optionally_take_a__static__list_of_component_indices](https://github.com/sagemath/sagetrac-mirror/tree/u/mkoeppe/mixedintegerlinearprogram_new_variable_could_optionally_take_a__static__list_of_component_indices)** to **[`23689dd`](https://github.com/sagemath/sagetrac-mirror/commit/23689ddb190d6e2847fd492c91c996a7afa2bbea)**",
"created_at": "2018-09-21T22:20:38Z",
"formatter": "markdown",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_comment",
"url": "https://github.com/sagemath/sage/issues/20773#issuecomment-301255",
"user": "https://github.com/vbraun"
}
Changed branch from u/mkoeppe/mixedintegerlinearprogram_new_variable_could_optionally_take_a__static__list_of_component_indices to 23689dd
archive/issue_events_289896.json:
{
"actor": "https://github.com/vbraun",
"created_at": "2018-09-21T22:20:38Z",
"event": "unlabeled",
"issue": "https://github.com/sagemath/sage/issues/20773",
"label": "https://github.com/sagemath/sage/labels/positive%20review",
"label_color": "dfffc0",
"label_name": "positive review",
"label_text_color": "ffffff",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289896"
}
archive/issue_events_289897.json:
{
"actor": "https://github.com/vbraun",
"commit_id": "b34b14d1727b1859a6de646e90ac23e3143d1368",
"commit_repository": "https://github.com/sagemath/sage",
"created_at": "2018-09-21T22:20:38Z",
"event": "closed",
"issue": "https://github.com/sagemath/sage/issues/20773",
"type": "issue_event",
"url": "https://github.com/sagemath/sage/issues/20773#event-289897"
}