)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"5e12686c1104e5f2462c796212ef3077294c86f6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Normalize the scheduler weights."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The weighter was usint the raw values instead of normalizing them."},{"line_number":10,"context_line":"If somebody wants to implement any weighter different than RAM we"},{"line_number":11,"context_line":"have to ensure that all weights are normalized before doing anything"},{"line_number":12,"context_line":"with them (that is, before applying the multiplier and before we sum"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAAOn%2F%2F1Q8%3D","line":9,"updated":"2013-04-19 16:53:22.000000000","message":"typo here \u0027usint\u0027","commit_id":"709e56ec8009092dfcbb3b75bd096b190d8eb8b3"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"f8eb583ef8de4977281116b96ec025eecd956e5a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the weighter is using the raw values instead of normalizing"},{"line_number":10,"context_line":"them. This makes difficult to properly use multipliers for establishing"},{"line_number":11,"context_line":"the relative importance between two wheigters (one big magnitude could"},{"line_number":12,"context_line":"shade a smaller one)."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This commit introduces weight normalization so that we can apply"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAOn%2F%2Fx8s%3D","line":11,"updated":"2013-04-23 17:14:38.000000000","message":"weighters","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"eef807dea75036bfa370b3cbf233ed29b4ca3cb0","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the weighter is using the raw values instead of normalizing"},{"line_number":10,"context_line":"them. This makes difficult to properly use multipliers for establishing"},{"line_number":11,"context_line":"the relative importance between two wheigters (one big magnitude could"},{"line_number":12,"context_line":"shade a smaller one)."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This commit introduces weight normalization so that we can apply"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAOn%2F%2Fw60%3D","line":11,"in_reply_to":"AAAAOn%2F%2Fx8s%3D","updated":"2013-04-24 07:52:46.000000000","message":"Done","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"f8eb583ef8de4977281116b96ec025eecd956e5a","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    weight \u003d w1_multiplier * norm(w1) + w2_multiplier * norm(w2) + ..."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Also, a new \"ram_weight_inverse\" flag has been introduced for the"},{"line_number":23,"context_line":"RAMWeighter. Before, the weigther stated that to change the behaviour"},{"line_number":24,"context_line":"to \"stacking\" instead of \"spreading\", a negative multiplier would do"},{"line_number":25,"context_line":"the trick but this is not true when using more that one weighter."},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAOn%2F%2Fx8c%3D","line":23,"updated":"2013-04-23 17:14:38.000000000","message":"weighter","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"eef807dea75036bfa370b3cbf233ed29b4ca3cb0","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    weight \u003d w1_multiplier * norm(w1) + w2_multiplier * norm(w2) + ..."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Also, a new \"ram_weight_inverse\" flag has been introduced for the"},{"line_number":23,"context_line":"RAMWeighter. Before, the weigther stated that to change the behaviour"},{"line_number":24,"context_line":"to \"stacking\" instead of \"spreading\", a negative multiplier would do"},{"line_number":25,"context_line":"the trick but this is not true when using more that one weighter."},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAOn%2F%2Fw6w%3D","line":23,"in_reply_to":"AAAAOn%2F%2Fx8c%3D","updated":"2013-04-24 07:52:46.000000000","message":"Done","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"f8eb583ef8de4977281116b96ec025eecd956e5a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Also, a new \"ram_weight_inverse\" flag has been introduced for the"},{"line_number":23,"context_line":"RAMWeighter. Before, the weigther stated that to change the behaviour"},{"line_number":24,"context_line":"to \"stacking\" instead of \"spreading\", a negative multiplier would do"},{"line_number":25,"context_line":"the trick but this is not true when using more that one weighter."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"DocImpact"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAOn%2F%2Fx8w%3D","line":25,"updated":"2013-04-23 17:14:38.000000000","message":"that -\u003e than","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"eef807dea75036bfa370b3cbf233ed29b4ca3cb0","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Also, a new \"ram_weight_inverse\" flag has been introduced for the"},{"line_number":23,"context_line":"RAMWeighter. Before, the weigther stated that to change the behaviour"},{"line_number":24,"context_line":"to \"stacking\" instead of \"spreading\", a negative multiplier would do"},{"line_number":25,"context_line":"the trick but this is not true when using more that one weighter."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"DocImpact"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAOn%2F%2Fw6s%3D","line":25,"in_reply_to":"AAAAOn%2F%2Fx8w%3D","updated":"2013-04-24 07:52:46.000000000","message":"Done","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"c7b2bf257c66a17c95d381dbe7ac4921cfaf6429","unresolved":false,"context_lines":[{"line_number":21,"context_line":"    weight \u003d w1_multiplier * norm(w1) + w2_multiplier * norm(w2) + ..."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"2) weights.BaseWeigher has been changed into an ABC so that we enforce"},{"line_number":24,"context_line":"that all weighers have the expceted methods."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"3) weights.BaseWeigher.weigh_objects() does no longer sum up the"},{"line_number":27,"context_line":"computer weighs to the object, but it rather returns a list that will be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"AAAAP3%2F%2FimU%3D","line":24,"updated":"2013-07-16 20:08:56.000000000","message":"typo: expceted","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"1f4362b15bdff25e3926f621baefd0a1ddf37fe5","unresolved":false,"context_lines":[{"line_number":21,"context_line":"    weight \u003d w1_multiplier * norm(w1) + w2_multiplier * norm(w2) + ..."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"2) weights.BaseWeigher has been changed into an ABC so that we enforce"},{"line_number":24,"context_line":"that all weighers have the expceted methods."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"3) weights.BaseWeigher.weigh_objects() does no longer sum up the"},{"line_number":27,"context_line":"computer weighs to the object, but it rather returns a list that will be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"AAAAP3%2F%2FgbE%3D","line":24,"in_reply_to":"AAAAP3%2F%2FimU%3D","updated":"2013-07-17 08:07:53.000000000","message":"Done","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"4) Adapt the existing weighers to the above changes."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"5) unittests for all of the above"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Implements blueprint normalize-scheduler-weights"},{"line_number":65,"context_line":"DocImpact"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"AAAATn%2F%2FUi0%3D","line":62,"updated":"2013-11-11 00:43:54.000000000","message":"6) Dropping mute_weight_value option\n\n7) Added offset_weight_multiplier","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"49fc352b2cdb3702c979cd3ba91f012191c5bac9","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"4) Adapt the existing weighers to the above changes."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"5) unittests for all of the above"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Implements blueprint normalize-scheduler-weights"},{"line_number":65,"context_line":"DocImpact"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"AAAATn%2F%2FTWk%3D","line":62,"in_reply_to":"AAAATn%2F%2FUi0%3D","updated":"2013-11-11 16:43:13.000000000","message":"\u0026 has been done in a separate commit, see https://review.openstack.org/55873","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":62,"context_line":"5) unittests for all of the above"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"Implements blueprint normalize-scheduler-weights"},{"line_number":65,"context_line":"DocImpact"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"Change-Id: I81bf90898d3cb81541f4390596823cc00106eb20"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"AAAATn%2F%2FUiw%3D","line":65,"updated":"2013-11-11 00:43:54.000000000","message":"Please include in the documentation hints - e.g. the commit message - enough information to tell deployers how to migrate their config files (e.g. how to cater for the dropped mute_weight_value option and how to migrate their mute_weight_multiplier values.","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"}],"doc/source/devref/filter_scheduler.rst":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"f8eb583ef8de4977281116b96ec025eecd956e5a","unresolved":false,"context_lines":[{"line_number":245,"context_line":"Weights"},{"line_number":246,"context_line":"-------"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"Filter Scheduler uses called **weights** during its work."},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"The Filter Scheduler weights hosts based on the config option"},{"line_number":251,"context_line":"`scheduler_weight_classes`, this defaults to"}],"source_content_type":"text/x-rst","patch_set":7,"id":"AAAAOn%2F%2Fx8Y%3D","line":248,"updated":"2013-04-23 17:14:38.000000000","message":"I would just remove \"called\" here.","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"eef807dea75036bfa370b3cbf233ed29b4ca3cb0","unresolved":false,"context_lines":[{"line_number":245,"context_line":"Weights"},{"line_number":246,"context_line":"-------"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"Filter Scheduler uses called **weights** during its work."},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"The Filter Scheduler weights hosts based on the config option"},{"line_number":251,"context_line":"`scheduler_weight_classes`, this defaults to"}],"source_content_type":"text/x-rst","patch_set":7,"id":"AAAAOn%2F%2Fw6o%3D","line":248,"in_reply_to":"AAAAOn%2F%2Fx8Y%3D","updated":"2013-04-24 07:52:46.000000000","message":"Done","commit_id":"e289dd0fa9659f260dea0545a5fff68e6ea63143"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f3bd502abd9dcbc37869ef264693c96f50ed7ef3","unresolved":false,"context_lines":[{"line_number":254,"context_line":""},{"line_number":255,"context_line":"Weights"},{"line_number":256,"context_line":"-------"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"Filter Scheduler uses the so called **weights** during its work."},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"The Filter Scheduler weighs hosts based on the config option"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAP3%2F%2F8oY%3D","line":257,"updated":"2013-07-08 18:43:12.000000000","message":"Can you please add a definition for what weights and weighers are?","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d0525882ed7553039408eda9590a177f6f9d68b8","unresolved":false,"context_lines":[{"line_number":254,"context_line":""},{"line_number":255,"context_line":"Weights"},{"line_number":256,"context_line":"-------"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"Filter Scheduler uses the so called **weights** during its work."},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"The Filter Scheduler weighs hosts based on the config option"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAP3%2F%2F604%3D","line":257,"in_reply_to":"AAAAP3%2F%2F8oY%3D","updated":"2013-07-10 08:42:08.000000000","message":"Yes, sure.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"c7b2bf257c66a17c95d381dbe7ac4921cfaf6429","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            return total_usable_ram_mb * FLAGS.ram_allocation_ratio  - used_ram_mb \u003e\u003d requested_ram"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"Here ``ram_allocation_ratio`` means the virtual RAM to physical RAM allocation"},{"line_number":128,"context_line":"ratio (it is ``1.5`` by default). Really, nice and simple."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"Next standard filter to describe is |AvailabilityZoneFilter| and it isn\u0027t"},{"line_number":131,"context_line":"difficult too. This filter just looks at the availability zone of compute node"}],"source_content_type":"text/x-rst","patch_set":12,"id":"AAAAP3%2F%2FipI%3D","line":128,"updated":"2013-07-16 20:08:56.000000000","message":"these changes should be in a separate patch","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"1f4362b15bdff25e3926f621baefd0a1ddf37fe5","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            return total_usable_ram_mb * FLAGS.ram_allocation_ratio  - used_ram_mb \u003e\u003d requested_ram"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"Here ``ram_allocation_ratio`` means the virtual RAM to physical RAM allocation"},{"line_number":128,"context_line":"ratio (it is ``1.5`` by default). Really, nice and simple."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"Next standard filter to describe is |AvailabilityZoneFilter| and it isn\u0027t"},{"line_number":131,"context_line":"difficult too. This filter just looks at the availability zone of compute node"}],"source_content_type":"text/x-rst","patch_set":12,"id":"AAAAP3%2F%2FgbA%3D","line":128,"in_reply_to":"AAAAP3%2F%2FipI%3D","updated":"2013-07-17 08:07:53.000000000","message":"Done","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    weight \u003d w1_multiplier * norm(w1) + w2_multiplier * norm(w2) + ..."},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"A weigher should be a subclass of ``weights.BaseHostWeigher`` and they must"},{"line_number":278,"context_line":"implement the ``weight_multiplier`` and ``weight_object`` methods. If the "},{"line_number":279,"context_line":"``weight_objects`` method is overriden it just return a list of weights, and not"},{"line_number":280,"context_line":"modify the weight of the object directly, since final weights are normalized and"},{"line_number":281,"context_line":"computed by ``weight.BaseWeightHandler``."}],"source_content_type":"text/x-rst","patch_set":25,"id":"AAAATn%2F%2FUjc%3D","line":278,"updated":"2013-11-11 00:43:54.000000000","message":"Trailing whitespace.","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"49fc352b2cdb3702c979cd3ba91f012191c5bac9","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    weight \u003d w1_multiplier * norm(w1) + w2_multiplier * norm(w2) + ..."},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"A weigher should be a subclass of ``weights.BaseHostWeigher`` and they must"},{"line_number":278,"context_line":"implement the ``weight_multiplier`` and ``weight_object`` methods. If the "},{"line_number":279,"context_line":"``weight_objects`` method is overriden it just return a list of weights, and not"},{"line_number":280,"context_line":"modify the weight of the object directly, since final weights are normalized and"},{"line_number":281,"context_line":"computed by ``weight.BaseWeightHandler``."}],"source_content_type":"text/x-rst","patch_set":25,"id":"AAAATn%2F%2FTV8%3D","line":278,"in_reply_to":"AAAATn%2F%2FUjc%3D","updated":"2013-11-11 16:43:13.000000000","message":"Done","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"82ab34a26b47218b8eb7d892374775cbddc19408","unresolved":false,"context_lines":[{"line_number":287,"context_line":"* |RamWeigher| Hosts are then weighted and sorted with the largest weight winning."},{"line_number":288,"context_line":"  If the multiplier is negative, the host with less RAM available will win (useful"},{"line_number":289,"context_line":"  for stacking hosts, instead of spreading)."},{"line_number":290,"context_line":"\u003e\u003e\u003e\u003e\u003e\u003e\u003e 9b8d0f5... Normalize the weights instead of using raw values"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"Filter Scheduler finds local list of acceptable hosts by repeated filtering and"},{"line_number":293,"context_line":"weighing. Each time it chooses a host, it virtually consumes resources on it,"}],"source_content_type":"text/x-rst","patch_set":30,"id":"AAAATn%2F9ayQ%3D","line":290,"updated":"2013-12-11 18:28:06.000000000","message":"Rebase remains","commit_id":"16e533a986749b3bc2471ac8ec2ce999a848c37f"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"a3212ebf835ef654f62b366928aefa5a37582b48","unresolved":false,"context_lines":[{"line_number":287,"context_line":"* |RamWeigher| Hosts are then weighted and sorted with the largest weight winning."},{"line_number":288,"context_line":"  If the multiplier is negative, the host with less RAM available will win (useful"},{"line_number":289,"context_line":"  for stacking hosts, instead of spreading)."},{"line_number":290,"context_line":"\u003e\u003e\u003e\u003e\u003e\u003e\u003e 9b8d0f5... Normalize the weights instead of using raw values"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"Filter Scheduler finds local list of acceptable hosts by repeated filtering and"},{"line_number":293,"context_line":"weighing. Each time it chooses a host, it virtually consumes resources on it,"}],"source_content_type":"text/x-rst","patch_set":30,"id":"AAAATn%2F9afg%3D","line":290,"in_reply_to":"AAAATn%2F9ayQ%3D","updated":"2013-12-11 19:26:08.000000000","message":"D\u0027oh!","commit_id":"16e533a986749b3bc2471ac8ec2ce999a848c37f"}],"nova/cells/weights/mute_child.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f3bd502abd9dcbc37869ef264693c96f50ed7ef3","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                default\u003d-1.0,"},{"line_number":32,"context_line":"                help\u003d\u0027Multiplier used to weigh mute children.  (The value \u0027"},{"line_number":33,"context_line":"                     \u0027should be negative.)\u0027),"},{"line_number":34,"context_line":"         cfg.IntOpt(\"mute_child_interval\","},{"line_number":35,"context_line":"                default\u003d300,"},{"line_number":36,"context_line":"                help\u003d\u0027Number of seconds after which a lack of capability and \u0027"},{"line_number":37,"context_line":"                     \u0027capacity updates signals the child cell is to be \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F8n4%3D","line":34,"updated":"2013-07-08 18:43:12.000000000","message":"This option is already defined in nova.cells.opts.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d0525882ed7553039408eda9590a177f6f9d68b8","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                default\u003d-1.0,"},{"line_number":32,"context_line":"                help\u003d\u0027Multiplier used to weigh mute children.  (The value \u0027"},{"line_number":33,"context_line":"                     \u0027should be negative.)\u0027),"},{"line_number":34,"context_line":"         cfg.IntOpt(\"mute_child_interval\","},{"line_number":35,"context_line":"                default\u003d300,"},{"line_number":36,"context_line":"                help\u003d\u0027Number of seconds after which a lack of capability and \u0027"},{"line_number":37,"context_line":"                     \u0027capacity updates signals the child cell is to be \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F60w%3D","line":34,"in_reply_to":"AAAAP3%2F%2F8n4%3D","updated":"2013-07-10 08:42:08.000000000","message":"You\u0027re right, probably it is here because of a wrong merge.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f3bd502abd9dcbc37869ef264693c96f50ed7ef3","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            # yep, that\u0027s a mute child;  recommend highly that it be skipped!"},{"line_number":66,"context_line":"            LOG.warn(_(\"%(cell)s has not been seen since %(last_seen)s and is \""},{"line_number":67,"context_line":"                       \"being treated as mute.\") % locals())"},{"line_number":68,"context_line":"            return 1.0"},{"line_number":69,"context_line":"        else:"},{"line_number":70,"context_line":"            return 0.0"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F8nk%3D","line":68,"updated":"2013-07-08 18:43:12.000000000","message":"These should probably be defined constants so it\u0027s a little easier to read and know what these values represent.  (1.0 and 0.0)","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d0525882ed7553039408eda9590a177f6f9d68b8","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            # yep, that\u0027s a mute child;  recommend highly that it be skipped!"},{"line_number":66,"context_line":"            LOG.warn(_(\"%(cell)s has not been seen since %(last_seen)s and is \""},{"line_number":67,"context_line":"                       \"being treated as mute.\") % locals())"},{"line_number":68,"context_line":"            return 1.0"},{"line_number":69,"context_line":"        else:"},{"line_number":70,"context_line":"            return 0.0"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F600%3D","line":68,"in_reply_to":"AAAAP3%2F%2F8nk%3D","updated":"2013-07-10 08:42:08.000000000","message":"I do agree.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"c7b2bf257c66a17c95d381dbe7ac4921cfaf6429","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                     \u0027should be negative.)\u0027),"},{"line_number":34,"context_line":"        cfg.FloatOpt(\u0027mute_weight_value\u0027,"},{"line_number":35,"context_line":"                default\u003d1000.0,"},{"line_number":36,"context_line":"                help\u003d\u0027Weight value assigned to mute children.  (The value \u0027"},{"line_number":37,"context_line":"                     \u0027should be positive.)\u0027),"},{"line_number":38,"context_line":"]"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2Fil8%3D","side":"PARENT","line":36,"updated":"2013-07-16 20:08:56.000000000","message":"Why is this removed?","commit_id":"2f5287e2cb5be95030e0d6656d7f17a61be8085b"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"1f4362b15bdff25e3926f621baefd0a1ddf37fe5","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                     \u0027should be negative.)\u0027),"},{"line_number":34,"context_line":"        cfg.FloatOpt(\u0027mute_weight_value\u0027,"},{"line_number":35,"context_line":"                default\u003d1000.0,"},{"line_number":36,"context_line":"                help\u003d\u0027Weight value assigned to mute children.  (The value \u0027"},{"line_number":37,"context_line":"                     \u0027should be positive.)\u0027),"},{"line_number":38,"context_line":"]"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2FgbI%3D","side":"PARENT","line":36,"in_reply_to":"AAAAP3%2F%2Fil8%3D","updated":"2013-07-17 08:07:53.000000000","message":"Because it is useless. If you normalize weights it is not relevant at all. Two objects in a weigher, with weights [0,1] and [0,1000] will be normalized to [0,1].","commit_id":"2f5287e2cb5be95030e0d6656d7f17a61be8085b"}],"nova/cells/weights/ram_by_instance_type.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f3bd502abd9dcbc37869ef264693c96f50ed7ef3","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.cells import weights"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ram_weigher_opts \u003d ["},{"line_number":24,"context_line":"        cfg.BoolOpt(\u0027ram_weight_inverse\u0027,"},{"line_number":25,"context_line":"                    default\u003dFalse,"},{"line_number":26,"context_line":"                    help\u003d\u0027If set to True, the highest weight will be \u0027"},{"line_number":27,"context_line":"                          \u0027for the host with less RAM available (the \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F8lY%3D","line":24,"updated":"2013-07-08 18:43:12.000000000","message":"This seems like a new feature (a good one) that has nothing to do with normalizing weight values.  I would prefer to see things like this in its own commit.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d0525882ed7553039408eda9590a177f6f9d68b8","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from nova.cells import weights"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ram_weigher_opts \u003d ["},{"line_number":24,"context_line":"        cfg.BoolOpt(\u0027ram_weight_inverse\u0027,"},{"line_number":25,"context_line":"                    default\u003dFalse,"},{"line_number":26,"context_line":"                    help\u003d\u0027If set to True, the highest weight will be \u0027"},{"line_number":27,"context_line":"                          \u0027for the host with less RAM available (the \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F3Ho%3D","line":24,"in_reply_to":"AAAAP3%2F%2F8lY%3D","updated":"2013-07-10 08:42:08.000000000","message":"I will split this into a separate commit.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f3bd502abd9dcbc37869ef264693c96f50ed7ef3","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        ram_free \u003d cell.capacities.get(\u0027ram_free\u0027, {})"},{"line_number":58,"context_line":"        units_by_mb \u003d ram_free.get(\u0027units_by_mb\u0027, {})"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        ret \u003d units_by_mb.get(str(memory_needed), 0)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        if CONF.cells.ram_weight_inverse:"},{"line_number":63,"context_line":"            ret \u003d - ret"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F8m0%3D","line":60,"updated":"2013-07-08 18:43:12.000000000","message":"\u0027units\u0027 might be a more obvious name","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d0525882ed7553039408eda9590a177f6f9d68b8","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        ram_free \u003d cell.capacities.get(\u0027ram_free\u0027, {})"},{"line_number":58,"context_line":"        units_by_mb \u003d ram_free.get(\u0027units_by_mb\u0027, {})"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        ret \u003d units_by_mb.get(str(memory_needed), 0)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        if CONF.cells.ram_weight_inverse:"},{"line_number":63,"context_line":"            ret \u003d - ret"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F3Hg%3D","line":60,"in_reply_to":"AAAAP3%2F%2F8m0%3D","updated":"2013-07-10 08:42:08.000000000","message":"Done","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"}],"nova/scheduler/weights/ram.py":[{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"c7b2bf257c66a17c95d381dbe7ac4921cfaf6429","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class RAMWeigher(weights.BaseHostWeigher):"},{"line_number":46,"context_line":"    def weight_multiplier(self):"},{"line_number":47,"context_line":"        \"\"\"Override the weight multiplier.\"\"\""},{"line_number":48,"context_line":"        return CONF.ram_weight_multiplier"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2FijU%3D","line":46,"updated":"2013-07-16 20:08:56.000000000","message":"Won\u0027t this Weigher? have the minval maxval normalization issue?","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"4e004829fa5d251730dac7ed5a7a4eef57460f0b","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class RAMWeigher(weights.BaseHostWeigher):"},{"line_number":46,"context_line":"    def weight_multiplier(self):"},{"line_number":47,"context_line":"        \"\"\"Override the weight multiplier.\"\"\""},{"line_number":48,"context_line":"        return CONF.ram_weight_multiplier"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAQn%2F%2F%2Fa4%3D","line":46,"in_reply_to":"AAAAP3%2F%2FgaE%3D","updated":"2013-07-17 21:45:55.000000000","message":"The minumum ram value may not be zero. in which case  two nodes one with 5GB free and another with 10GB free will be normalized to [0,1] not [.5,1]","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"1f4362b15bdff25e3926f621baefd0a1ddf37fe5","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class RAMWeigher(weights.BaseHostWeigher):"},{"line_number":46,"context_line":"    def weight_multiplier(self):"},{"line_number":47,"context_line":"        \"\"\"Override the weight multiplier.\"\"\""},{"line_number":48,"context_line":"        return CONF.ram_weight_multiplier"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2FgaE%3D","line":46,"in_reply_to":"AAAAP3%2F%2FijU%3D","updated":"2013-07-17 08:07:53.000000000","message":"What do you mean?","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"658fc59f9cb7df432c6a4899fa9a11905bd91ab9","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class RAMWeigher(weights.BaseHostWeigher):"},{"line_number":46,"context_line":"    def weight_multiplier(self):"},{"line_number":47,"context_line":"        \"\"\"Override the weight multiplier.\"\"\""},{"line_number":48,"context_line":"        return CONF.ram_weight_multiplier"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAQn%2F%2F%2BLg%3D","line":46,"in_reply_to":"AAAAQn%2F%2F%2Fa4%3D","updated":"2013-07-18 08:35:59.000000000","message":"Yes indeed, but I do not think this is a problem in this particular case. However, we could add a minval it if needed.","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"}],"nova/tests/scheduler/test_weights.py":[{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"cba14d82e495d0c29dd31fef527bdc6599023a39","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        # host3: free_ram_mb\u003d3072"},{"line_number":84,"context_line":"        # host4: free_ram_mb\u003d8192"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # so, host4 should win:"},{"line_number":87,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":88,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":89,"context_line":"        self.assertEqual(weighed_host.obj.host, \u0027host1\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2F1V8%3D","line":86,"updated":"2013-04-19 14:27:41.000000000","message":"Comment should be \"host1 should win\", shouldn\u0027t it?","commit_id":"62932ce862dc427f69778776abf41d8997ee1634"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"298793506cc5b7633c4eb9569dc4221783481dbd","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        # host3: free_ram_mb\u003d3072"},{"line_number":84,"context_line":"        # host4: free_ram_mb\u003d8192"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # so, host4 should win:"},{"line_number":87,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":88,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":89,"context_line":"        self.assertEqual(weighed_host.obj.host, \u0027host1\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2F1Vk%3D","line":86,"in_reply_to":"AAAAOn%2F%2F1V8%3D","updated":"2013-04-19 14:40:50.000000000","message":"Nice catch.","commit_id":"62932ce862dc427f69778776abf41d8997ee1634"}],"nova/tests/test_weights.py":[{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"7518741fb16a2039af6e747bf48feda54ecab9b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2011-2012 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAATn%2F9bhI%3D","line":1,"updated":"2013-12-11 16:09:35.000000000","message":"How about \"Copyright 2013 OpenStack Foundation\"","commit_id":"16e533a986749b3bc2471ac8ec2ce999a848c37f"}],"nova/weights.py":[{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"cba14d82e495d0c29dd31fef527bdc6599023a39","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    values are equal they are normalized to 0."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    lmax \u003d max(list) * 1.0"},{"line_number":30,"context_line":"    lmin \u003d min(list) * 1.0"},{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0 for x in list]"},{"line_number":33,"context_line":"    range_ \u003d lmax - lmin"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2F1V4%3D","line":30,"updated":"2013-04-19 14:27:41.000000000","message":"What is the purpose of multiplying by 1.0 here? To get lmax and lmin to float values?","commit_id":"62932ce862dc427f69778776abf41d8997ee1634"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"298793506cc5b7633c4eb9569dc4221783481dbd","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    values are equal they are normalized to 0."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    lmax \u003d max(list) * 1.0"},{"line_number":30,"context_line":"    lmin \u003d min(list) * 1.0"},{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0 for x in list]"},{"line_number":33,"context_line":"    range_ \u003d lmax - lmin"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2F1Vc%3D","line":30,"in_reply_to":"AAAAOn%2F%2F1V4%3D","updated":"2013-04-19 14:40:50.000000000","message":"Yes, that\u0027s it.","commit_id":"62932ce862dc427f69778776abf41d8997ee1634"},{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"5567233afb83362995a717e6d514e832589c5ce2","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova import loadables"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def normalize(list, normalize_to\u003d1.0):"},{"line_number":24,"context_line":"    \"\"\"Normalize the values in a list."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    Normalize the values between 0 and normalize_to (default 1.0). If all the"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2F1OM%3D","line":23,"updated":"2013-04-19 18:33:40.000000000","message":"Using list as a variable name shadows a builtin.  Use something like list1 or lst instead.","commit_id":"709e56ec8009092dfcbb3b75bd096b190d8eb8b3"},{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"5567233afb83362995a717e6d514e832589c5ce2","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    lmax \u003d max(list) * 1.0"},{"line_number":30,"context_line":"    lmin \u003d min(list) * 1.0"},{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0 for x in list]"},{"line_number":33,"context_line":"    range_ \u003d lmax - lmin"},{"line_number":34,"context_line":"    return [normalize_to * (i - lmin) / range_ for i in list]"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2F1OI%3D","line":32,"updated":"2013-04-19 18:33:40.000000000","message":"return len(list) * [lmax] woulld avoid the loop, though I doubt it really matters in practice.","commit_id":"709e56ec8009092dfcbb3b75bd096b190d8eb8b3"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"7ffbe5cab7e8202b9c7898f94e01a7fc24cd2565","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    Normalize the values between 0 and normalize_to (default 1.0). If all the"},{"line_number":27,"context_line":"    values are equal they are normalized to 0."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    lmax \u003d max(weight_list) * 1.0"},{"line_number":30,"context_line":"    lmin \u003d min(weight_list) * 1.0"},{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0] * len(weight_list)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2Fwm8%3D","line":29,"updated":"2013-04-24 14:48:23.000000000","message":"O(n) operations - see comment on L68.\n\nAlso, there is an explicit way to cast to float with the float() function.","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"bda02a9c304970884a5b43614fa45f4f37d83c58","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    Normalize the values between 0 and normalize_to (default 1.0). If all the"},{"line_number":27,"context_line":"    values are equal they are normalized to 0."},{"line_number":28,"context_line":"    \"\"\""},{"line_number":29,"context_line":"    lmax \u003d max(weight_list) * 1.0"},{"line_number":30,"context_line":"    lmin \u003d min(weight_list) * 1.0"},{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0] * len(weight_list)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPH%2F%2FhoA%3D","line":29,"in_reply_to":"AAAAOn%2F%2Fwm8%3D","updated":"2013-06-10 11:16:06.000000000","message":"Done","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"d32eb38683a1fd787d41c503454e7694a570a764","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0] * len(weight_list)"},{"line_number":33,"context_line":"    range_ \u003d lmax - lmin"},{"line_number":34,"context_line":"    return [normalize_to * (i - lmin) / range_ for i in weight_list]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class WeighedObject(object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2Fwg4%3D","line":34,"updated":"2013-04-24 15:50:28.000000000","message":"In accordance with Brian\u0027s optimizations below, you could actually replace the braces with parens and turn this into a full on generator rather than iterating the list of weights twice.","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"bda02a9c304970884a5b43614fa45f4f37d83c58","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    if lmax \u003d\u003d lmin:"},{"line_number":32,"context_line":"        return [0] * len(weight_list)"},{"line_number":33,"context_line":"    range_ \u003d lmax - lmin"},{"line_number":34,"context_line":"    return [normalize_to * (i - lmin) / range_ for i in weight_list]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class WeighedObject(object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPH%2F%2Fhn8%3D","line":34,"in_reply_to":"AAAAOn%2F%2Fwg4%3D","updated":"2013-06-10 11:16:06.000000000","message":"Done","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"7ffbe5cab7e8202b9c7898f94e01a7fc24cd2565","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Calculate the weights"},{"line_number":66,"context_line":"        weights \u003d []"},{"line_number":67,"context_line":"        for obj in weighed_obj_list:"},{"line_number":68,"context_line":"            weights.append(self._weigh_object(obj.obj, weight_properties))"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        # normalize, multiply and sum up"},{"line_number":71,"context_line":"        weights \u003d normalize(weights)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2FwnA%3D","line":68,"updated":"2013-04-24 14:48:23.000000000","message":"Could pre-record the max and min here for a little extra performance.","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"bda02a9c304970884a5b43614fa45f4f37d83c58","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Calculate the weights"},{"line_number":66,"context_line":"        weights \u003d []"},{"line_number":67,"context_line":"        for obj in weighed_obj_list:"},{"line_number":68,"context_line":"            weights.append(self._weigh_object(obj.obj, weight_properties))"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        # normalize, multiply and sum up"},{"line_number":71,"context_line":"        weights \u003d normalize(weights)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPH%2F%2Fhn4%3D","line":68,"in_reply_to":"AAAAOn%2F%2FwnA%3D","updated":"2013-06-10 11:16:06.000000000","message":"Done","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"7ffbe5cab7e8202b9c7898f94e01a7fc24cd2565","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        # normalize, multiply and sum up"},{"line_number":71,"context_line":"        weights \u003d normalize(weights)"},{"line_number":72,"context_line":"        for obj in weighed_obj_list:"},{"line_number":73,"context_line":"            obj.weight +\u003d (self._weight_multiplier() *"},{"line_number":74,"context_line":"                           weights[weighed_obj_list.index(obj)])"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2Fwm4%3D","line":72,"updated":"2013-04-24 14:48:23.000000000","message":"If you do the following, you can skip the slow index() operation below:\n\n#Assuming weights is a generator from normalize():\n\nfor i, weight in enumerate(weights):\n    obj \u003d weighed_obj_list[i]\n    obj.weight +\u003d self._weight_multiplier() * weight","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"bda02a9c304970884a5b43614fa45f4f37d83c58","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        # normalize, multiply and sum up"},{"line_number":71,"context_line":"        weights \u003d normalize(weights)"},{"line_number":72,"context_line":"        for obj in weighed_obj_list:"},{"line_number":73,"context_line":"            obj.weight +\u003d (self._weight_multiplier() *"},{"line_number":74,"context_line":"                           weights[weighed_obj_list.index(obj)])"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPH%2F%2Fhn0%3D","line":72,"in_reply_to":"AAAAOn%2F%2Fwg0%3D","updated":"2013-06-10 11:16:06.000000000","message":"Done","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"d32eb38683a1fd787d41c503454e7694a570a764","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        # normalize, multiply and sum up"},{"line_number":71,"context_line":"        weights \u003d normalize(weights)"},{"line_number":72,"context_line":"        for obj in weighed_obj_list:"},{"line_number":73,"context_line":"            obj.weight +\u003d (self._weight_multiplier() *"},{"line_number":74,"context_line":"                           weights[weighed_obj_list.index(obj)])"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAOn%2F%2Fwg0%3D","line":72,"in_reply_to":"AAAAOn%2F%2Fwm4%3D","updated":"2013-04-24 15:50:28.000000000","message":"+1 to this","commit_id":"03ccb2195f424d6ed53675b773f7c52016bc15ad"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f3bd502abd9dcbc37869ef264693c96f50ed7ef3","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":"        return 1.0"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    @abc.abstractmethod"},{"line_number":84,"context_line":"    def _weigh_object(self, obj, weight_properties):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F8lA%3D","line":81,"updated":"2013-07-08 18:43:12.000000000","message":"Maybe define a constant MAXIMUM_WEIGHT?","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d0525882ed7553039408eda9590a177f6f9d68b8","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":"        return 1.0"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    @abc.abstractmethod"},{"line_number":84,"context_line":"    def _weigh_object(self, obj, weight_properties):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAP3%2F%2F3Hw%3D","line":81,"in_reply_to":"AAAAP3%2F%2F8lA%3D","updated":"2013-07-10 08:42:08.000000000","message":"Hmm, I think it could be misleading.\n\nNormalization can be made regarding a maximum value specified by the weigher (if maxval is not None) or regarding the maximum computed weight from the list (if maxval is None). Setting a maximum value for the weigher would imply that all the weights would be normalized according to MAXIMUM_WEIGHT, and it is not always true.","commit_id":"77211ab3c070bafe81be75e4acb3c7cd0a8ba98a"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"c7b2bf257c66a17c95d381dbe7ac4921cfaf6429","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def normalize(weight_list, normalize_to\u003d1.0, minval\u003dNone, maxval\u003dNone):"},{"line_number":26,"context_line":"    \"\"\"Normalize the values in a list between 0..normalize_to (default 1.0)."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The normalization is made regarding the lower and upper values present in"},{"line_number":29,"context_line":"    weight_list. If the minval and/or maxval parameters are set, these values"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2Fios%3D","line":26,"updated":"2013-07-16 20:08:56.000000000","message":"why is normalize_to even an option?","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"1f4362b15bdff25e3926f621baefd0a1ddf37fe5","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def normalize(weight_list, normalize_to\u003d1.0, minval\u003dNone, maxval\u003dNone):"},{"line_number":26,"context_line":"    \"\"\"Normalize the values in a list between 0..normalize_to (default 1.0)."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The normalization is made regarding the lower and upper values present in"},{"line_number":29,"context_line":"    weight_list. If the minval and/or maxval parameters are set, these values"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2FgaU%3D","line":26,"in_reply_to":"AAAAP3%2F%2Fios%3D","updated":"2013-07-17 08:07:53.000000000","message":"Done","commit_id":"75c09795d1c4a14266914c4a64ff5973dabb2cd5"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":"        return 1.0"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FUic%3D","line":78,"updated":"2013-11-11 00:43:54.000000000","message":"This shouldn\u0027t be an abstractmethod as you offer a default. abstract method is used when you need to force overriding. \"Using this decorator requires that the class’s metaclass is ABCMeta or is derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract methods can be called using any of the normal ‘super’ call mechanisms.\"","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"49fc352b2cdb3702c979cd3ba91f012191c5bac9","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":"        return 1.0"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FTVc%3D","line":78,"in_reply_to":"AAAATn%2F%2FUic%3D","updated":"2013-11-11 16:43:13.000000000","message":"Done","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":"        return 1.0"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    @abc.abstractmethod"},{"line_number":84,"context_line":"    def _weigh_object(self, obj, weight_properties):"},{"line_number":85,"context_line":"        \"\"\"Weigh an specific object.\"\"\""},{"line_number":86,"context_line":"        return 0.0"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FUiY%3D","line":83,"updated":"2013-11-11 00:43:54.000000000","message":"Also not appropriate to mark abstract, or if it is, raise NotImplementedError in this one, as you\u0027re not expecting upcalls.","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"49fc352b2cdb3702c979cd3ba91f012191c5bac9","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":"        return 1.0"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    @abc.abstractmethod"},{"line_number":84,"context_line":"    def _weigh_object(self, obj, weight_properties):"},{"line_number":85,"context_line":"        \"\"\"Weigh an specific object.\"\"\""},{"line_number":86,"context_line":"        return 0.0"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FTVg%3D","line":83,"in_reply_to":"AAAATn%2F%2FUiY%3D","updated":"2013-11-11 16:43:13.000000000","message":"Done","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def weigh_objects(self, weighed_obj_list, weight_properties):"},{"line_number":89,"context_line":"        \"\"\"Weigh multiple objects.  Override in a subclass if you need"},{"line_number":90,"context_line":"        need access to all objects in order to calculate weights. Do not"},{"line_number":91,"context_line":"        modify the weight of an object here, just return a list of weights."},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        # Calculate the weights"},{"line_number":94,"context_line":"        weights \u003d []"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FUiQ%3D","line":91,"updated":"2013-11-11 00:43:54.000000000","message":"Since you\u0027re editing the docstring, please put it into normal form with a one-line summary, a blank line, then the rest.","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"49fc352b2cdb3702c979cd3ba91f012191c5bac9","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def weigh_objects(self, weighed_obj_list, weight_properties):"},{"line_number":89,"context_line":"        \"\"\"Weigh multiple objects.  Override in a subclass if you need"},{"line_number":90,"context_line":"        need access to all objects in order to calculate weights. Do not"},{"line_number":91,"context_line":"        modify the weight of an object here, just return a list of weights."},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        # Calculate the weights"},{"line_number":94,"context_line":"        weights \u003d []"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FTVk%3D","line":91,"in_reply_to":"AAAATn%2F%2FUiQ%3D","updated":"2013-11-11 16:43:13.000000000","message":"Done","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"a629460cac59e6ced035e44a1e54e5146380ab06","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            weighing_properties):"},{"line_number":120,"context_line":"        \"\"\"Return a sorted, highest score first, list of normalized"},{"line_number":121,"context_line":"        WeighedObjects."},{"line_number":122,"context_line":"        \"\"\""},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        if not obj_list:"},{"line_number":125,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FUiM%3D","line":122,"updated":"2013-11-11 00:43:54.000000000","message":"Ditto. In fact, you\u0027re breaking this one :).\n\nI suggest \n\n\"\"\"Return a sorted (descending) and normalized list of WeighedObjects.\"\"\"","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"49fc352b2cdb3702c979cd3ba91f012191c5bac9","unresolved":false,"context_lines":[{"line_number":119,"context_line":"            weighing_properties):"},{"line_number":120,"context_line":"        \"\"\"Return a sorted, highest score first, list of normalized"},{"line_number":121,"context_line":"        WeighedObjects."},{"line_number":122,"context_line":"        \"\"\""},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        if not obj_list:"},{"line_number":125,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2FTVo%3D","line":122,"in_reply_to":"AAAATn%2F%2FUiM%3D","updated":"2013-11-11 16:43:13.000000000","message":"Done","commit_id":"b82e9357c6a645ffb6060fb13b12a00830cc9902"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"c8406ddb3db70738f680fe72e20117917773713d","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F989U%3D","line":78,"updated":"2013-12-04 03:03:41.000000000","message":"I\u0027m confused; you said \u0027Done\u0027 in response to my comment about abstractmethod, but it\u0027s still here :)","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"79480afaaa3b0cd83d4004e429354481e0c792ba","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F9zKI%3D","line":78,"in_reply_to":"AAAATn%2F92Oc%3D","updated":"2013-12-05 19:27:09.000000000","message":"If someones natural range is [0..1], their multiplier will be 1. I understand your desire to make sure they do sensible things, but honestly, I don\u0027t think you can force correctness like this - folk will just put a noddy figure in here and forget about it until they get a bug report.","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"d00b4bc36e6e01b6ccc25cc479eba5f2113ca34c","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F92Oc%3D","line":78,"in_reply_to":"AAAATn%2F93ZU%3D","updated":"2013-12-05 09:45:53.000000000","message":"I get your point now, but I really want to force developers to implement an explicit multiplier for their weigher.\n\nWith weight normalization, since the maximum value that a weigher will return is \"1\", it is needed a way to specify a multiplier. Since I cannot force devs to add a configuration option (i.e. CONF.my_brand_new_wigher_multiplier) I need to force them to implement this method.\n\nThe not implemented exception below is just in case somebody calls the method by means of super().","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"0f332a046019d5b91456a2c8ccfa7c7e41ba2706","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F98AI%3D","line":78,"in_reply_to":"AAAATn%2F989U%3D","updated":"2013-12-04 09:04:59.000000000","message":"What do you mean? I thought that your comment was about returning a default value, that has been removed.\n\nShould I raise a NotImplementedError also here?","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"e455a3eaf869b3790d26366e368fccaf29c2805a","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F93ZU%3D","line":78,"in_reply_to":"AAAATn%2F98AI%3D","updated":"2013-12-05 03:21:06.000000000","message":"No, my comment was that abstractmethod shouldn\u0027t be used unless you want to *force* everyone to reimplement it. When there is a sensible default, abstractmethod is plain wrong.\n\nIt wasn\u0027t clear to me which methods here you want to force folk to reimplement, and which you want to allow them to reimplement if they choose.\n\nOnce in the former camp you should mark @abc.abstractmethod, and *do not need* a raise NotImeplementedError() in them.\n\nOnes in the latter camp should not have @abc.abstractmethod and should have a sensible default method.\n\nRight now I would put weight_multiplier in the latter camp - choose - and remove the abstractmethod and return a multiplier of 1. _weigh_object I would put in the former camp - must reimplement - and remove the raise, as it\u0027s irrelevant with the abstractmethod in place.","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"2c9112cdce46a5ea01b788031ca493733d3d4eab","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    minval \u003d None"},{"line_number":76,"context_line":"    maxval \u003d None"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    @abc.abstractmethod"},{"line_number":79,"context_line":"    def weight_multiplier(self):"},{"line_number":80,"context_line":"        \"\"\"How weighted this weigher should be.\"\"\""},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F9rH0%3D","line":78,"in_reply_to":"AAAATn%2F9zKI%3D","updated":"2013-12-08 19:24:55.000000000","message":"Even if their range is [0..1], the multiplier is needed. It is the only way that an operator can specify how important a weigher is. However I see your concerns, so I think that I will change this, with a better docstring.","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"79480afaaa3b0cd83d4004e429354481e0c792ba","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    @abc.abstractmethod"},{"line_number":83,"context_line":"    def _weigh_object(self, obj, weight_properties):"},{"line_number":84,"context_line":"        \"\"\"Weigh an specific object.\"\"\""},{"line_number":85,"context_line":"        raise NotImplementedError()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def weigh_objects(self, weighed_obj_list, weight_properties):"},{"line_number":88,"context_line":"        \"\"\"Weigh multiple objects."}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F9zKk%3D","line":85,"updated":"2013-12-05 19:27:09.000000000","message":"Ok, so lets split the discussion into the two methods.\n\nIf you raise here you force people *not* to call super, but calling super() is expected: you\u0027re deliberately making Weigher code harder to review. Thats a bad thing. The more consistency and standard patterns we follow the easier to review and the easier to predict. It\u0027s fine to force people to implement the method, but don\u0027t force them to break normal Python patterns.","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"},{"author":{"_account_id":91,"name":"Alvaro","email":"aloga@ifca.unican.es","username":"aloga"},"change_message_id":"2c9112cdce46a5ea01b788031ca493733d3d4eab","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    @abc.abstractmethod"},{"line_number":83,"context_line":"    def _weigh_object(self, obj, weight_properties):"},{"line_number":84,"context_line":"        \"\"\"Weigh an specific object.\"\"\""},{"line_number":85,"context_line":"        raise NotImplementedError()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def weigh_objects(self, weighed_obj_list, weight_properties):"},{"line_number":88,"context_line":"        \"\"\"Weigh multiple objects."}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAATn%2F9rH4%3D","line":85,"in_reply_to":"AAAATn%2F9zKk%3D","updated":"2013-12-08 19:24:55.000000000","message":"Hmm, you\u0027re totally right. I will amend it right now. Thanks for the explanation!","commit_id":"9449706281a6b386b1b185c1a09bc6598c542b8b"}]}
