[Erp5-report] r31476 jp - /erp5/trunk/products/ERP5/interfaces/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Dec 28 09:40:38 CET 2009


Author: jp
Date: Mon Dec 28 09:40:37 2009
New Revision: 31476

URL: http://svn.erp5.org?rev=31476&view=rev
Log:
During the review of simulation refactoring with Kaz, we found that it made more sense to implement movement aggregation at the applied rule level and implement and N to M matching process rather than a 1 to N. This requires AmountGenerator and MovementGenerator to provide a separate API with no aggregation. Moreover, aggregation process should if possible be implemented consistently accross ERP5. DivergenceTesters seem to be the appropriate core component for that. MovementGroup themselves could be based on embedded DivergenceTesters and getAggregated* method could use themselved MovementGroup, either temporary instances dynamically generated, or existing instances found in appropriate context. This gives an idea of future directions. However, initial implementation will focus first on stable expand.

Modified:
    erp5/trunk/products/ERP5/interfaces/amount_generator.py
    erp5/trunk/products/ERP5/interfaces/movement_generator.py
    erp5/trunk/products/ERP5/interfaces/movement_group.py

Modified: erp5/trunk/products/ERP5/interfaces/amount_generator.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/amount_generator.py?rev=31476&r1=31475&r2=31476&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/amount_generator.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/amount_generator.py [utf8] Mon Dec 28 09:40:37 2009
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
 #                    Jean-Paul Smets-Solanes <jp at nexedi.com>
-#                    Łukasz Nowak <luke at nexedi.com>
+#                    Lukasz Nowak <luke at nexedi.com>
 #
 # WARNING: This program as such is intended to be used by professional
 # programmers who take the whole responsibility of assessing all potential
@@ -46,6 +46,26 @@
   def getAggregatedAmountList(context, movement_list=None, rounding=False):
     """
     Returns an IAmountList generated by a model applied to the context.
+    and aggregated according to the context divergence testers.
+
+    context - an IMovementCollection, an IAmountList or an IAmount
+
+    movement_list - optional IAmountList which can be passed explicitly
+                    whenever context is an IMovementCollection and whenever
+                    we want to filter context.getMovementList
+
+    rounding - boolean argument, which controls if rounding shall be applied on
+               generated movements or not
+
+    NOTE:
+      - implement rounding appropriately (True or False seems
+        simplistic)
+      - define how to retrieve divergence testers in the context
+    """
+
+  def getGeneratedAmountList(context, movement_list=None, rounding=False):
+    """
+    Returns an IAmountList generated by a model applied to the context.
 
     context - an IMovementCollection, an IAmountList or an IAmount
 

Modified: erp5/trunk/products/ERP5/interfaces/movement_generator.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/movement_generator.py?rev=31476&r1=31475&r2=31476&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/movement_generator.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/movement_generator.py [utf8] Mon Dec 28 09:40:37 2009
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
 #                    Jean-Paul Smets-Solanes <jp at nexedi.com>
-#                    Łukasz Nowak <luke at nexedi.com>
+#                    Lukasz Nowak <luke at nexedi.com>
 #
 # WARNING: This program as such is intended to be used by professional
 # programmers who take the whole responsibility of assessing all potential
@@ -45,7 +45,8 @@
 
   def getAggregatedMovementList(context, movement_list=None, rounding=False):
     """
-    Returns an IMovementList generated by a model applied to the context.
+    Returns an IMovementList generated by a model applied to the context
+    and aggregated according to the context divergence testers.
 
     context - an IMovementCollection, an IMovementList or an IMovement
 
@@ -59,4 +60,23 @@
     NOTE:
       - implement rounding appropriately (True or False seems
         simplistic)
+      - define how to retrieve divergence testers in the context
     """
+
+  def getGeneratedMovementList(context, movement_list=None, rounding=False):
+    """
+    Returns an IMovementList generated by a model applied to the context
+
+    context - an IMovementCollection, an IMovementList or an IMovement
+
+    movement_list - optional IMovementList which can be passed explicitely
+                    whenever context is an IMovementCollection and whenever
+                    we want to filter context.getMovementList
+
+    rounding - boolean argument, which controls if rounding shall be applied on
+               generated movements or not
+
+    NOTE:
+      - implement rounding appropriately (True or False seems
+        simplistic)
+    """

Modified: erp5/trunk/products/ERP5/interfaces/movement_group.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/movement_group.py?rev=31476&r1=31475&r2=31476&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/movement_group.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/movement_group.py [utf8] Mon Dec 28 09:40:37 2009
@@ -32,14 +32,22 @@
 class IMovementGroup(Interface):
   """Movement Group interface specification
 
-  The purpose of MovementGroup is to define how movements are grouped,
-  and how values are updated from simulation movements.
+  The purpose of MovementGroup is to define how movements are grouped, [YES] XXX
+  and how values are updated from simulation movements. [NO] XXX
   """
   def test(document, property_dict, **kw):
     """Returns a tuple of 2 values.
     First one is True if document contains identical values than some 
     contained property_dict.
     Second one is a modified version of property_dict.
+
+    TODO:
+      - take into account the possibility to use Divergence Testers
+        to build movement groups
+      - how does separate method relate to matching provided by 
+        Divergence Testers
+      - consider an interface for property groups. Is it the same or
+        different ?
     """
 
   def separate(movement_list):




More information about the Erp5-report mailing list