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

%%Table node_loads
LOAD,NODEID,DIRN,F
Wind,B,FX,-200000.

@sl.extend(Frame2D)
class Frame2D:
    
    COLUMNS_node_loads = ('LOAD','NODEID','DIRN','F')
    
    def install_node_loads(self):
        table = self.get_table('node_loads')
        dirns = ['FX','FY','FZ']
        for ix,row in table.data.iterrows():
            n = self.get_node(row.NODEID)
            if row.DIRN not in dirns:
                raise ValueError("Invalid node load direction: {} for load {}, node {}; must be one of '{}'"
                                .format(row.DIRN, row.LOAD, row.NODEID, ', '.join(dirns)))
            l = makeNodeLoad({row.DIRN:row.F})
            self.nodeloads.append(row.LOAD,n,l)
        self.rawdata.node_loads = table

##test:
f.install_node_loads()

##test:
for o,l,fact in f.nodeloads.iterloads('Wind'):
    print(o,l,fact,l*fact)