PPPLDeepLearning / plasma-python

PPPL deep learning disruption prediction package
http://tigress-web.princeton.edu/~alexeys/docs-web/html/
79 stars 43 forks source link

Jenkins test + Python3 and 1D Profile Fixes #26

Closed ASvyatkovskiy closed 6 years ago

ASvyatkovskiy commented 6 years ago

This PR provides full build integration for Python 2.7 and Python 3.6 with Jenkins + additional classes for running Jenkins tests in parallel (for future use).

  1. Bug fixes for Python 3.6: tab-space inconsistencies, slicing errors due to float indexes.

  2. In addition, it changes hashing function from default python hash to stable hashlib's md5 for reproducibility between Python 2 and Python 3. No need to set PYTHONHASHSEED with hashlib.md5

  3. Fix interpolation error in edens_profile 1D profile signal (D3D, ZIPFIT01/PROFILES.EDENSFIT):

            if sig[i,order].shape[0] > 2:
                f = UnivariateSpline(mapping[i,order],sig[i,order],s=0,k=1,ext=0)
                sig_interp[i,:] = f(remapping)
            else:
                print('Signal {}, shot {} has not enough points for linear interpolation. dfitpack.error: (m>k) failed for hidden m: fpcurf0:m=1'.format(self.description,shot.number))
ASvyatkovskiy commented 6 years ago

Will merge for now, some D3D features might need to be reviewed in a separate pull request