예제 #1
0
 def create_node(self, node_path):
     """
     Create a node at the end of the given path; all but the final node in the path must already exist.
     """
     core.validate_node_path(node_path)
     existing, new = core.split(node_path)
     existing_node = self._get_node(existing)
     existing_node[self._node][new] = {self._node: {},
                                       self._array: {}}
예제 #2
0
 def create_node(self, node_path):
     existing, new = core.split(node_path)
     if not new:
         raise core.MeasurementError("Cannot create root node.")
     self._get_node(existing).createGroup(new)
예제 #3
0
 def create_node(self, node_path):
     existing, new = core.split(node_path)
     if not new:
         raise core.MeasurementError("Cannot create root node.")
     os.mkdir(os.path.join(self._get_node(existing), new))
예제 #4
0
def test_split():
    assert core.split('') == ('', '')
    assert core.split('one') == ('', 'one')
    assert core.split('/one') == ('/', 'one')
    assert core.split('one/two/three') == ('one/two', 'three')
    assert core.split('/one/two/three') == ('/one/two', 'three')
예제 #5
0
 def create_node(self, node_path):
     existing, new = core.split(node_path)
     if not new:
         raise core.MeasurementError("Cannot create root node.")
     self._get_node(existing).createGroup(new)
예제 #6
0
def test_split():
    assert core.split('') == ('', '')
    assert core.split('one') == ('', 'one')
    assert core.split('/one') == ('/', 'one')
    assert core.split('one/two/three') == ('one/two', 'three')
    assert core.split('/one/two/three') == ('/one/two', 'three')
예제 #7
0
파일: npy.py 프로젝트: vapor36/kid_readout
 def create_node(self, node_path):
     existing, new = core.split(node_path)
     if not new:
         raise core.MeasurementError("Cannot create root node.")
     os.mkdir(os.path.join(self._get_node(existing), new))