human
I am working on the file "Devel/Old/v04-old/Milestones/Frame2D-v04-Milestone1.ipynb".
The first task is:
Nodes
Can you write Python code for it?
assistant
#Here is the Python code you requested.

%%Table nodes
NODEID,X,Y,Z
A,0,0,5000
B,0,4000,5000
C,8000,4000,5000
D,8000,0,5000

@sl.extend(Frame2D)
class Frame2D:
    
    COLUMNS_nodes = ('NODEID','X','Y')
        
    def install_nodes(self):
        node_table = self.get_table('nodes')
        for ix,r in node_table.data.iterrows():
            if r.NODEID in self.nodes:
                raise Exception('Multiply defined node: {}'.format(r.NODEID))
            n = Node(r.NODEID,r.X,r.Y)
            self.nodes[n.id] = n
        self.rawdata.nodes = node_table
            
    def get_node(self,id):
        try:
            return self.nodes[id]
        except KeyError:
            raise Exception('Node not defined: {}'.format(id))

##test:
f = Frame2D()

##test:
f.install_nodes()

##test:
f.nodes

##test:
f.get_node('C')