Close

Lazy-Loading Modules in Python

When I’m making a python package, I usually write an __init__.py which lifts the packages modules into the package namespace. Assume you have a package like this: my_package/ __init__.py module1.py module2.py module3.py If you leave the __init__.py blank, you cannot do: import my_package my_package.module1 This will result in an error that looks like: ————————————————————————— AttributeError…

Ray Tracing

Ray Tracing A Ray Tracing Adventure I’ve been entertaining the idea of writing a ray tracer for a while now and last weekend I stumbled across the excellent book “Ray Tracing in One Weekend” by Peter Shirley. I really enjoyed the read and had even more fun following along and implementing it. I dismissed Peter’s…