)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30fb24606515f761c78e93a91dcee3af49697377","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Don\u0027t recompute weighers\u0027 minval/maxval attributes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Changing the minval/maxval attribute to the minimum/maxium of every"},{"line_number":10,"context_line":"weigher run changes the outcome of future runs. We noticed it in the"},{"line_number":11,"context_line":"SoftAffinityWeigher, where a previous run with a host hosting a lot of"},{"line_number":12,"context_line":"instances for a server-group would make a later run use that maximum."},{"line_number":13,"context_line":"This resulted in the weight being lower than 1 for a host hosting all"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"df33271e_41ad6599","line":10,"updated":"2020-04-01 15:38:00.000000000","message":"Also storing information in the weigher between scheduling attempts is wrong. Each scheduling attempt needs to be independent from any previous one.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30fb24606515f761c78e93a91dcee3af49697377","unresolved":false,"context_lines":[{"line_number":22,"context_line":"The code now uses the maxval/minval as defined by the weigher and keeps"},{"line_number":23,"context_line":"the weights inside the maxval-minval range. There\u0027s also only one place"},{"line_number":24,"context_line":"to compute the minval/maxval now, if the weigher did not set a value:"},{"line_number":25,"context_line":"normalize()."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Closes-Bug: 1870096"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"df33271e_c1bfb5a7","line":25,"updated":"2020-04-01 15:38:00.000000000","message":"There was one semantic change that I was unsure about. Previously if the Weigher defined a min/max value and a weight was smaller / bigger than that then the min/max value was changed according to the weight. Now the weight is always forced to be between the min/max defined by the Weigher.\n\nBut then reading the doc of minval/maxval the intention is that the weight of an object never go out of this range. And the current implementation just forces that properly.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5af04ba0ad4f990d38313fb00013ccaa7353b851","unresolved":false,"context_lines":[{"line_number":22,"context_line":"The code now uses the maxval/minval as defined by the weigher and keeps"},{"line_number":23,"context_line":"the weights inside the maxval-minval range. There\u0027s also only one place"},{"line_number":24,"context_line":"to compute the minval/maxval now, if the weigher did not set a value:"},{"line_number":25,"context_line":"normalize()."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Closes-Bug: 1870096"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"df33271e_ccce4ab3","line":25,"in_reply_to":"df33271e_c1bfb5a7","updated":"2020-06-01 13:16:59.000000000","message":"Yeah, this is an additional feature, rather than a bug fix as such. But without it, I can see a bug where would need this feature to fix that bug. OK I have lost myself there, but hey.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"}],"nova/tests/unit/scheduler/weights/test_weights_affinity.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30fb24606515f761c78e93a91dcee3af49697377","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                      expected_weight\u003d1.0,"},{"line_number":175,"context_line":"                      expected_host\u003d\u0027host2\u0027,"},{"line_number":176,"context_line":"                      group\u003d\u0027other\u0027)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"class SoftAntiAffinityWeigherTestCase(SoftWeigherTestBase):"},{"line_number":180,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_616ce907","line":177,"updated":"2020-04-01 15:38:00.000000000","message":"Double checked and if I remove the bugfix then the second run of the weigher is influenced by the first run.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"}],"nova/weights.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"05b804c8ff2e1779024edc45b21c84db0093bcad","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            # Record the min and max values if they are None. If they are"},{"line_number":110,"context_line":"            # anything but none, we assume that the weigher had set them."},{"line_number":111,"context_line":"            if self.minval is None:"},{"line_number":112,"context_line":"                self.minval \u003d weight"},{"line_number":113,"context_line":"            if self.maxval is None:"},{"line_number":114,"context_line":"                self.maxval \u003d weight"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_cc36c151","side":"PARENT","line":112,"updated":"2020-04-01 21:38:56.000000000","message":"Idea example of de-coupling \"configured\" minval from \"dynamic\" minval:\n\n if self.minval is None:\n     self.dynamic_minval \u003d weight","commit_id":"d83bc6fed0d38d0382d35bfb3799abe7f74090a9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"05b804c8ff2e1779024edc45b21c84db0093bcad","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            if weight \u003c self.minval:"},{"line_number":117,"context_line":"                self.minval \u003d weight"},{"line_number":118,"context_line":"            elif weight \u003e self.maxval:"},{"line_number":119,"context_line":"                self.maxval \u003d weight"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"            weights.append(weight)"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_ac16dda6","side":"PARENT","line":119,"updated":"2020-04-01 21:38:56.000000000","message":"Idea example of de-coupling, these would all be changed from self.minval and self.maxval to self.dynamic_minval and self.dynamic_maxval","commit_id":"d83bc6fed0d38d0382d35bfb3799abe7f74090a9"},{"author":{"_account_id":26250,"name":"Johannes Kulik","email":"johannes.kulik@sap.com","username":"jkulik"},"change_message_id":"984142ba0d57d82bad3543a31524f3c28f1eefbe","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return ()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    if maxval is None:"},{"line_number":41,"context_line":"        maxval \u003d max(weight_list)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if minval is None:"},{"line_number":44,"context_line":"        minval \u003d min(weight_list)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_aaa6b8bf","line":41,"updated":"2020-04-02 07:03:51.000000000","message":"@melanie witt\nThis is to my understanding the exact same functionality you propose to have for \"dynamic_minval\" already built into \"normalize()\" if we pass \"None\" for minval or maxval. No need to compute it again in \"weigh_objects()\".","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9c52fe143e06d86fc695616b46127ea10a98bf77","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return ()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    if maxval is None:"},{"line_number":41,"context_line":"        maxval \u003d max(weight_list)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if minval is None:"},{"line_number":44,"context_line":"        minval \u003d min(weight_list)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_d6ad3d9c","line":41,"in_reply_to":"df33271e_6f2c904a","updated":"2020-04-07 14:37:43.000000000","message":"I think we broke this at some point, in theory each run should have its own instance of the weigher... I need to go check the history here.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":26250,"name":"Johannes Kulik","email":"johannes.kulik@sap.com","username":"jkulik"},"change_message_id":"8edec909fdb8027d0985bc3b85fd176787473ddc","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return ()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    if maxval is None:"},{"line_number":41,"context_line":"        maxval \u003d max(weight_list)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if minval is None:"},{"line_number":44,"context_line":"        minval \u003d min(weight_list)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_fc4d16c4","line":41,"in_reply_to":"df33271e_7ccd8bb5","updated":"2020-04-03 06:30:08.000000000","message":"That\u0027s at least not how the code worked previously. It only updated the max value of a single weigher with all the objects in a run - not across mulitple weighers. So in the end, we computed the max value of all objects a weigher has ever seen since last restart. But still confined to a single weigher, so different weighers could have different maxval.\n\nThe \"dynamic_maxval\" you propose, if kept at the point where I removed the code for saving the max value on the weigher, would also only save the maximum value of a single weigher\u0027s objects. If we clear it after each run, that\u0027s equivalent to the code in normalize, as you described:\n\u003e this logic you underlined will only find the max value of all objects being considered by a single weigher","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"efa642a3f62a593f2245453c2de8601625b40745","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return ()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    if maxval is None:"},{"line_number":41,"context_line":"        maxval \u003d max(weight_list)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if minval is None:"},{"line_number":44,"context_line":"        minval \u003d min(weight_list)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_7ccd8bb5","line":41,"in_reply_to":"df33271e_aaa6b8bf","updated":"2020-04-02 22:28:52.000000000","message":"Well, what I was thinking is that the idea of the existing self.maxval \"saving\" the value every time was that it finds the max value of all objects across all of the weighers.\n\nThis logic you underlined will only find the max value of all objects being considered by a single weigher. This maxval will not incorporate the maxval of previous weighers [in a single run].\n\nWith the \"dynamic_maxval\" we would be able to bump up our max value based on what each weigher sees, so by the time the last weigher runs, it would normalize based on the latest max value.\n\nThe problem as I understand it is that the \"saved\" maxval doesn\u0027t get cleared out after each scheduling run, so that it is a fresh start for a new scheduling run.\n\nDoes that make sense?","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"70e440d3e51996f1b7cee0387ae38538580cca76","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return ()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    if maxval is None:"},{"line_number":41,"context_line":"        maxval \u003d max(weight_list)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    if minval is None:"},{"line_number":44,"context_line":"        minval \u003d min(weight_list)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_6f2c904a","line":41,"in_reply_to":"df33271e_fc4d16c4","updated":"2020-04-04 01:35:36.000000000","message":"Guh, I see now -- only each weigher saved a min/max. Sorry about that. Thanks for being patient about it.\n\nHm. I guess that proves that I still don\u0027t understand why the original code made a point of saving a running min/max of everything since last restart.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"05b804c8ff2e1779024edc45b21c84db0093bcad","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            if self.minval is not None:"},{"line_number":111,"context_line":"                weight \u003d max(weight, self.minval)"},{"line_number":112,"context_line":"            if self.maxval is not None:"},{"line_number":113,"context_line":"                weight \u003d min(weight, self.maxval)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            weights.append(weight)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_6ce5f537","line":113,"updated":"2020-04-01 21:38:56.000000000","message":"I had a look at the review that originally added the minval/maxval logic [1] to learn how it was intended to be used (warning, it is very old).\n\nHere\u0027s a quote of a comment by Hans Lindgren:\n\n\"If I have a weigher for a resource that ranges between 1 and 100 and normalize the weights of two objects, the normalization will produce equal results for weights that differ on the scale (as long as the same object has the highest weight).\n\nFor weights [0, 1], this will result in normalized values [0.0, 1.0].\nFor weights [99, 100] this will still result in the same [0.0, 1.0].\n\nLets assume I have two objects and two weighers. Both weighers produce values in the same range (this could possibly be already normalized values like utilization of resources which range from 0.0 to 1.0). The weighers give weights [0.1, 0.2] and [1.0, 0.1] which without further normalization gives final weights [1.1, 0.3]. With the current way of calculating normalization, the result will instead be [1.0, 1.0] which has an effect on the ordering of the objects.\"\n\nThe code previous to this patch was gleaning the minval and maxval from the min and max the weigher sees as it considers objects, if it has not been set by the weigher class itself. I checked the in-tree weighers and found a few set minval, none set maxval, and most set neither.\n\nThis means that mostly the minval and maxval is calculated on-the-fly across all weighers in a run, based on what object values it sees (which makes sense to me).\n\nBased on this, I\u0027m thinking we probably don\u0027t want to remove this functionality entirely right? Given the issue presented by Hans years ago. This change would remove all of the consideration of the min and max values in a set of objects across weighers at the normalize() step because the normalize() call is only passed self.minval and self.maxval.\n\nSo, I\u0027m wondering if we could instead do something like de-couple the \"configured\" minval and maxval from the dynamically calculated minval and maxval and reset self.dynamic_minval and self.dynamic_maxval to None after each full run of weighers, so that previous runs don\u0027t influence future runs? Or maybe someone else has a better idea?\n\n[1] https://review.opendev.org/27160","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5af04ba0ad4f990d38313fb00013ccaa7353b851","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            if self.minval is not None:"},{"line_number":111,"context_line":"                weight \u003d max(weight, self.minval)"},{"line_number":112,"context_line":"            if self.maxval is not None:"},{"line_number":113,"context_line":"                weight \u003d min(weight, self.maxval)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            weights.append(weight)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff570b3c_6c13715d","line":113,"in_reply_to":"1f493fa4_05a10daa","updated":"2020-06-01 13:16:59.000000000","message":"really sorry, I have just spotted I have a follow up comment I never pubished here :(","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":26250,"name":"Johannes Kulik","email":"johannes.kulik@sap.com","username":"jkulik"},"change_message_id":"984142ba0d57d82bad3543a31524f3c28f1eefbe","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            if self.minval is not None:"},{"line_number":111,"context_line":"                weight \u003d max(weight, self.minval)"},{"line_number":112,"context_line":"            if self.maxval is not None:"},{"line_number":113,"context_line":"                weight \u003d min(weight, self.maxval)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            weights.append(weight)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_8ad93423","line":113,"in_reply_to":"df33271e_6ce5f537","updated":"2020-04-02 07:03:51.000000000","message":"Your quoted comment has some example computation. Let\u0027s add some more specificas to that: The two weighers both don\u0027t set maxval, but set minval to 0 - which is what the current in-tree weighers do. Imho, [0.1, 0.2] and [1.0, 0.1] returned by the weighers would then result in \"normalize()\" computing values of [0.5, 1.0] and [1.0, 0.1] which gives a result of [1.5, 1.1]. So something has changed to whatever Hans saw. Probably best seen in the sentence, which I believe doesn\u0027t hold true today\n\n \u003e For weights [99, 100] this will result in the same [0.0, 1.0]\n\nAs the changes here don\u0027t break any of the already existing test, we just had to add one to actually show the problem with the code, I\u0027m pretty confident that it should still work similar to before.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9c52fe143e06d86fc695616b46127ea10a98bf77","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            if self.minval is not None:"},{"line_number":111,"context_line":"                weight \u003d max(weight, self.minval)"},{"line_number":112,"context_line":"            if self.maxval is not None:"},{"line_number":113,"context_line":"                weight \u003d min(weight, self.maxval)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            weights.append(weight)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_f6aa0183","line":113,"in_reply_to":"df33271e_8ad93423","updated":"2020-04-07 14:37:43.000000000","message":"I think the fix might actually to store a minval and maxval for just this set of objects.\n\nI think its because we now cache the weigher objects, I need to go read the history a bit...","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":26250,"name":"Johannes Kulik","email":"johannes.kulik@sap.com","username":"jkulik"},"change_message_id":"ba710f649cf6e25c0c6b47d5a3e66652e061245f","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            if self.minval is not None:"},{"line_number":111,"context_line":"                weight \u003d max(weight, self.minval)"},{"line_number":112,"context_line":"            if self.maxval is not None:"},{"line_number":113,"context_line":"                weight \u003d min(weight, self.maxval)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            weights.append(weight)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f493fa4_05a10daa","line":113,"in_reply_to":"df33271e_f6aa0183","updated":"2020-05-08 09:33:25.000000000","message":"If we store the minval/maxval for this set of objects, then we could\n\n1) compute it later, too. That\u0027s whats implemented in \"normalize()\" already via \"max(weight_list)\".\n\n2) would in the implementation chosen before not adhere to the minval/maxval set by the weigher, i.e. overwrite explicitly set minvals","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5af04ba0ad4f990d38313fb00013ccaa7353b851","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            if self.minval is not None:"},{"line_number":111,"context_line":"                weight \u003d max(weight, self.minval)"},{"line_number":112,"context_line":"            if self.maxval is not None:"},{"line_number":113,"context_line":"                weight \u003d min(weight, self.maxval)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            weights.append(weight)"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_ccf5aaef","line":113,"in_reply_to":"df33271e_f6aa0183","updated":"2020-06-01 13:16:59.000000000","message":"So I think this code stopped working as intended after this change:\nhttps://github.com/openstack/nova/commit/c126d36640e0398e76ba01783b7f21f01f53a5f5\n\nWe always used to create a weigher object for each host list. I belive the original intent here was to avoid looping over the weights to determine the min and max. Although my memory around talking to SandyW/comstud about this is getting very hazy indeed. I am 99% sure that is a nonsese premature optimization (just like the quota reservation system we took out).\n\nYour code is changing things somewhat here... you are ensuring the limits are within what the weigher object as set as its minval and maxval. Now I think that is probably a noop for all the intree code, as the min_value \u003d 0 weighers always have a min_value of 0, etc.\n\nAll that aside, I think your code does restore the intended normalization behaviour, and also adds the feature of checking something claiming a min_value is 0 doesn\u0027t start returning negative values.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"05b804c8ff2e1779024edc45b21c84db0093bcad","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"            # Normalize the weights"},{"line_number":134,"context_line":"            weights \u003d normalize(weights,"},{"line_number":135,"context_line":"                                minval\u003dweigher.minval,"},{"line_number":136,"context_line":"                                maxval\u003dweigher.maxval)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"            for i, weight in enumerate(weights):"},{"line_number":139,"context_line":"                obj \u003d weighed_objs[i]"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_0cf6e9d7","line":136,"range":{"start_line":135,"start_character":32,"end_line":136,"end_character":53},"updated":"2020-04-01 21:38:56.000000000","message":"normalize() called with only self.minval and self.maxval\n\nWith the idea example, this would be like:\n\n minval\u003dweigher.minval or weigher.dynamic_minval\n maxval\u003dweigher.maxval or weigher.dynamic_maxval","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":26250,"name":"Johannes Kulik","email":"johannes.kulik@sap.com","username":"jkulik"},"change_message_id":"984142ba0d57d82bad3543a31524f3c28f1eefbe","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"            # Normalize the weights"},{"line_number":134,"context_line":"            weights \u003d normalize(weights,"},{"line_number":135,"context_line":"                                minval\u003dweigher.minval,"},{"line_number":136,"context_line":"                                maxval\u003dweigher.maxval)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"            for i, weight in enumerate(weights):"},{"line_number":139,"context_line":"                obj \u003d weighed_objs[i]"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_aac19856","line":136,"range":{"start_line":135,"start_character":32,"end_line":136,"end_character":53},"in_reply_to":"df33271e_0cf6e9d7","updated":"2020-04-02 07:03:51.000000000","message":"This would have to check for `None` instead of just `or`, if we use it. Because most `minval` are set to `0`.","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"05b804c8ff2e1779024edc45b21c84db0093bcad","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            for i, weight in enumerate(weights):"},{"line_number":139,"context_line":"                obj \u003d weighed_objs[i]"},{"line_number":140,"context_line":"                obj.weight +\u003d weigher.weight_multiplier(obj.obj) * weight"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        return sorted(weighed_objs, key\u003dlambda x: x.weight, reverse\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_ec974539","line":141,"updated":"2020-04-01 21:38:56.000000000","message":"Idea example of resetting the \"dynamic\" minval and maxval outside the loop where all weighers have weighed the objects:\n\n for weigher in weighers:\n     if weigher.minval is None:\n         weigher.dynamic_minval \u003d None\n     if weigher.maxval is None:\n         weigher.dynamic_maxval \u003d None","commit_id":"5ab9ef11e27014ce8b43e1bac76903fed70d0fbf"}]}
