During my time as a PhD student and a reasearch engineer at Simula, I have been written a lot of code. My preferred language is with no doubt python, a language which I had almost never used before I started my PhD.

Here you will find posts about the software and toolboxes that I have written as well as post about useful tips and tricks that I have encountered. Please check out my repositories at Github and Bitbucket for a full list of all my public coding projects.

Running matlab from python

Without a license

Did you know that you can take your existing Matlab code, compile it and turn it into a python package? Then you can distribute the packag and your first and import and run your package without having to buy a matlab license. Matlab is the number one choice for many researchers within the scientific computing community. There many reasons for this, for example the fact that Matlab is a commercial software provides confidence that the core functionality is robust and contains few bugs. [Read More]

Setters and getters in python

Often when you want to assign some variable within a class you want to check or do something before you assign a value to that variable. In most programming languages a common design pattern of getting or setting a variable on an object is to implement so called set and get functions. For example say we have a class Circle, that has a variable called radius. Then we should only allow a radius to be a number, and that number should be positive (what does a circle with a negative radius look like? [Read More]