Commit 8a48d5fa59535596fe9e4b53f3c1962510c8748e
1 parent
fb6cfc7d
Exists in
master
and in
2 other branches
Make sure spacepy's toolbox is up-to-date BEFORE we try to import pycdf, or it will fail miserably.
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
web/run.py
... | ... | @@ -1037,7 +1037,6 @@ def download_targets_cdf(targets, inp, started_at, stopped_at): |
1037 | 1037 | log.debug("Creating the CDF file '%s'..." % cdf_filename) |
1038 | 1038 | environ['SPACEPY'] = CACHE_DIR |
1039 | 1039 | environ['CDF_LIB'] = CDF_LIB |
1040 | - from spacepy import pycdf | |
1041 | 1040 | try: |
1042 | 1041 | # todo: maybe move this to the daily cache warmup ? |
1043 | 1042 | log.info("Updating spacepy's table of leap seconds…") |
... | ... | @@ -1046,6 +1045,11 @@ def download_targets_cdf(targets, inp, started_at, stopped_at): |
1046 | 1045 | except Exception as e: |
1047 | 1046 | log.error("Failed to update spacepy : %s." % e) |
1048 | 1047 | try: |
1048 | + from spacepy import pycdf | |
1049 | + except ImportError as e: | |
1050 | + log.error("Failed to import pycdf from spacepy : %s" % e) | |
1051 | + raise | |
1052 | + try: | |
1049 | 1053 | cdf_handle = pycdf.CDF(cdf_path, masterpath='') |
1050 | 1054 | description = "Model and orbit data for %s." % \ |
1051 | 1055 | ', '.join([t['name'] for t in targets_configs]) | ... | ... |