-
Notifications
You must be signed in to change notification settings - Fork 5
ABCCheckLattice assumes that e.g. get_node returns empty LatticeNodes #216
Comments
Could the fix just be changing the following line https://github.com/simphony/simphony-common/blob/master/simphony/testing/abc_check_lattice.py#L183 from:
As a work-around, could you still use |
@nathanfranklin, thanks for the ideas!
Unfortunately this breaks the template for other lattice classes, Lattice and H5Lattice. I have tried to avoid overriding for now, because I would have to override quite many tests if I went that road. But I'm still testing other ways of solving this. One of the other ways might be to get rid of JYULatticeProxy for good and replace it with a regular Lattice class, that is stored internally in the engine. One off-topic question: Is it required generally in Simphony, that engine statedata must be able to hold many datasets? Currently JyuLB is only supporting one lattice as its stored dataset. Looking at the engine test template it seems that many datasets should be supported (see e.g. abc_check_engine.iter_datasets test), but I could not find a clear specification from the wiki. I had to override some tests for JyuLB wrappers to be able to use this test template... |
Do you mean other tests in |
Oops. I quickly read the test..and misunderstood what it was testing. The line in question should remain as it is: It is changing the node's data to an empty data container and then making sure that doesn't have an affect in the node stored in the wrapper (i.e. it gets the node again and tests the that changed node doesn't equal the newly acquired node). |
I just added a comment on simphony-jyulb (simphony/simphony-jyulb@a79e935#commitcomment-14072222) that might address the problem encountered with the |
I don't know what the general requirement is... currently,we have |
Ok, if JyuLB is not the only wrapper allowing just one dataset, then I guess we can let it be that way for now. However, it would be nice if test_iter_datasets test is modified so that it checks if the wrapper can hold more than one and adjusts the test accordingly. Then possibly more wrappers, also from any future ones, can benefit from the test template. |
I think it's important to abbreviate here that there's quite a lot of differences in the lattice container behaviors and how the test template works:
create_data_container(restrict=self.supported_cuba()) then JYULatticeProxy will survive the test given that its supported_cuba is defined correctly. In this case the DataContainer would have the correct keys defined. The solution to this might be a simple one, but like always, it's not so easy to find. :) |
|
Or maybe even explicitly, so that the user could ask supported_cuba from the wrapper. Then they would be open to test templates as well.
This is a good point. We should try to solve this problem as generally as necessary just to avoid problems in future when new wrappers are implemented in Simphony. |
This has been proposed at https://publicwiki-01.fraunhofer.de/SimPhoNy-Project/index.php/Supported_CUBA_keys_for_container |
I was referring to the actual data values (e.g. a default value for density) |
Okay. I understand now. For the test templates, I totally agree that there the |
Ok, misunderstood that. Maybe wrapper should not provide these.
Thanks for the info @nathanfranklin.I'll take a look at it. |
Ok, I think this proposition is good and should be implemented as soon as possible, so that we can start using it for example for this issue. Do you know if this proposal is approved or not by the SSB? |
Related to simphony/simphony-common#216 For some tests in CheckLatticeNodeOperations it is expected that the `container_factory` has produced a lattice with nodes that are empty. And that then these data of the lattice nodes can be updated with cuba provided by the 'supported_cuba'. This doesn't match the behaviour of JYULatticeProxy and it requires that the supported cuba appear in the `external_node_data` parameter at object initialization. This has the effect that what CUBA appear on each node.data cannot be changed later.
No I don't but all the feedback has been positive so we should move that to the dev-team. But I wouldn't help this issue as it just affects the wrapper. I think what you said earlier about "the ABCheckLattice template is modified so that it does not expect empty nodes returned from get_node, and methods alike" is the way to go. This boils down to CheckLatticeNodeOperations requiring that:
|
ABCheckLattice template assumes that a lattice initiated for testing has no CUBA data stored in it's LatticeNode objects. If the lattice is initiated in the container_factory method with, say, CUBA.MATERIAL_ID defined for all nodes, then CheckLatticeNodeOperations.test_get_node causes an error because it assumes that the returned LatticeNode (node) has an empty DataContainer object as node.data.
JYULatticeProxy lattice has by default certain CUBA keywords defined for the lattice, so using a get_node always returns LatticeNodes that have non-empty DataContainer object accompanied with it. This is currently restricting us of using the test template for JYULatticeProxy.
I propose that ABCheckLattice template is modified so that it does not expect empty nodes returned from get_node, and methods alike. The change can be done by modifying the template, or compare_data_containers and compare_lattice_nodes methods from simphony.testing.utils.py
The text was updated successfully, but these errors were encountered: