Python — Nested Ifs

NESTED IFs: A question was asked recently on Stack Overflow The solution shown below is readable, scalable, easily edited — and contains no IF statements. This is similar to the method proposed by Anitoliy R except I use a single string and the split function to simplify editing and scaling. To illustrate scalability, I add […]

get_next, get_prev, in Python OrderedDict 08/2018

I provide an example class based on an OrderedDict — with an adjunct dictionary to index to the next and prev OrderedDict entry. In my case, I have a rather static OrderedDict: it is a dictionary of AISC shape objects. The function set_prev_next() must be called after each operation that modifies OrderedDict. class MyClass(coll.OrderedDict): mynpdict […]

ASCE 7-16 Ice Loading 04/2018

Function get_iceweight, a function of … structural shape all kinds of structural shapes pipe, HSS, bar L, 2L, 2L spaced C, MC W, S, M, HP WT, ST, MT ‘basic’ ice thickness from ASCE map importance factor for ice function of height above grade topographic factor ice density Excel implementation … Self documentation for function […]