BUG: write import numpy as np inside the class so that can dump class definition