Skip to content

Commit

Permalink
Revert "fix fieldmaps issue"
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravo135 authored Nov 30, 2022
1 parent 62f629f commit f6e635d
Showing 1 changed file with 6 additions and 38 deletions.
44 changes: 6 additions & 38 deletions python/hpsmc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 +235,15 @@ def config(self, parser):
if os.getenv("CONDITIONS_URL", None) is not None:
self.conditions_url = os.getenv("CONDITIONS_URL", None)
logger.debug('Set CONDITIONS_URL from environment: {}'.format(self.hps_java_bin_jar))
if self.hps_fieldmaps_dir is None:
self.hps_fieldmaps_dir = "{}/share/fieldmap".format(self.hpsmc_dir)
if not os.path.isdir(self.hps_fieldmaps_dir):
raise Exception("The fieldmaps dir does not exist: {}".format(self.hps_fieldmaps_dir))
logger.debug("Using fieldmap dir from install: {}".format(self.hps_fieldmaps_dir))
else:
logger.debug("Using fieldmap dir from config: {}".format(self.hps_fieldmaps_dir))

def required_config(self):
"""!
Return list of required configurations.
Required configurations are: **hps_java_bin_jar**, **hps_fieldmaps_dir**
Required configurations are: hps_java_bin_jar
@retun list of required configurations.
"""
return ['hps_java_bin_jar', 'hps_fieldmaps_dir']
return ['hps_java_bin_jar']

def setup(self):
"""! Setup JobManager component."""
Expand All @@ -261,12 +254,6 @@ def setup(self):
raise Exception("Steering '%s' not found in: %s" % (self.steering, self.steering_files))
self.steering_file = self.steering_files[self.steering]

logger.debug('Creating sym link to fieldmap dir: {}'.format(self.hps_fieldmaps_dir))
if not os.path.islink(os.getcwd() + os.path.sep + "fieldmap"):
os.symlink(self.hps_fieldmaps_dir, "fieldmap")
else:
logger.warning('Link to fieldmap dir already exists!')

def cmd_args(self):
"""!
Setup command arguments.
Expand Down Expand Up @@ -926,11 +913,11 @@ def __init__(self, name, java_class, **kwargs):
def required_config(self):
"""!
Return list of required config.
Required config are: **hps_java_bin_jar**, **hps_fieldmaps_dir**
Required config are: **hps_java_bin_jar**
@return list of required config
"""
return ['hps_java_bin_jar', 'hps_fieldmaps_dir']
return ['hps_java_bin_jar']

def cmd_args(self):
"""!
Expand All @@ -949,24 +936,6 @@ def cmd_args(self):
args.append(self.java_class)
return args

def config(self, parser):
super().config(parser)
if self.hps_fieldmaps_dir is None:
self.hps_fieldmaps_dir = "{}/share/fieldmap".format(self.hpsmc_dir)
if not os.path.isdir(self.hps_fieldmaps_dir):
raise Exception("The fieldmaps dir does not exist: {}".format(self.hps_fieldmaps_dir))
logger.debug("Using fieldmap dir from install: {}".format(self.hps_fieldmaps_dir))
else:
logger.debug("Using fieldmap dir from config: {}".format(self.hps_fieldmaps_dir))

def setup(self):
logger.debug('Creating sym link to fieldmap dir: {}'.format(self.hps_fieldmaps_dir))
if not os.path.islink(os.getcwd() + os.path.sep + "fieldmap"):
os.symlink(self.hps_fieldmaps_dir, "fieldmap")
else:
logger.warning('Link to fieldmap dir already exists!')


class EvioToLcio(JavaTool):
"""!
Convert EVIO events to LCIO using the hps-java EvioToLcio command line tool.
Expand Down Expand Up @@ -1016,7 +985,6 @@ def optional_parameters(self):

def setup(self):
"""! Setup EvioToLcio component."""
super().setup()
if self.steering not in self.steering_files:
raise Exception("Steering '%s' not found in: %s" % (self.steering, self.steering_files))
self.steering_file = self.steering_files[self.steering]
Expand Down

0 comments on commit f6e635d

Please sign in to comment.