Fixed handling for nperiodic_dimensions = 0. #461

14 jobs for fastapi in 25 minutes and 37 seconds