Alexandra K. Diem

Personal Website.
"Hiking is an excellent opportunity to scout out backcountry skiing routes while we wait for winter to come back."
During the Besseggen hike we got to check out the first sections of the Jotunheimen Høgruta #hauteroute from afar and I can only imagine what an awesome exciting winter adventure this will make!
.
.
.
#hiking #utpåtur #friluftsliv #turjenter #fjelltur #soveute #fjellsport #allemannsretten #besseggen #jotunheimen #nowaynorway Big boulder. Benoit for scale.
.
.
.
#hiking #utpåtur #friluftsliv #turjenter #fjelltur #soveute #fjellsport #allemannsretten #besseggen #jotunheimen #nowaynorway Jotunheimen needs no filter.
.
.
.
#hiking #utpåtur #friluftsliv #turjenter #fjelltur #soveute #fjellsport #allemannsretten #besseggen #jotunheimen #nowaynorway "Only about 30 switchbacks left!"
.
📷 @pvlvs
.
.
.
#mitziandfriends #radrace #tourdefriends #tourdefriends3 #tdf #storyoftheday #oneobsession #photooftheday #worldbybike #outsideisfree #fromwhereiride #cycling #womencycling #ladieseditioncc #landevei #utno #vegtur

Using eval() and configparser to convert units

Working with medical data means that I often have to convert between SI units and (outside of the medical community) lesser known units, such as Pa and mmHg for pressure. To simplify unit conversions and non-dimensionalsation for myself, I use a .cfg file that contains both unit conversions and parameters, which can be read by the eval() function.

The [Units] section is parsed first and entries are added to a dictionary iteratively. Each value is parsed using eval() with the dictionary. This means that previously encountered entries are automatically evaluated.

Below is a simple example of a .cfg file containing units and parameters and the corresponding code to parse the file.