Tweak to allow for case when weight is explicity None

if not going to quibble on python, but can't this be expressed weight = float(problem_descriptor.weight) if problem_descriptor.weight is not None else None.

This would avoid having this shift of data types from string here to float below.

Merging anyhow