Skip to content

Commit

Permalink
Now reading task from input from input parser
Browse files Browse the repository at this point in the history
  • Loading branch information
YHordijk committed Sep 24, 2023
1 parent 39c042d commit 0a36830
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
16 changes: 3 additions & 13 deletions TCutility/results/adf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,9 @@ def get_calc_settings(info: Result) -> Result:
reader_ams = cache.get(info.files['ams.rkf'])

Check failure on line 28 in TCutility/results/adf.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (F841)

TCutility/results/adf.py:28:5: F841 Local variable `reader_ams` is assigned to but never used
ret = Result()

# get the run type of the calculation
# read and split user input into words
user_input = reader_ams.read('General', 'user input').strip()
words = user_input.split()

# default task is SinglePoint
ret.task = 'SinglePoint'
for i, word in enumerate(words):
# task is always given with the task keyword
if word.lower() == 'task':
ret.task = words[i+1]
break

# set the calculation task at a higher level
ret.task = info.input.task

# determine if calculation used relativistic corrections
# if it did, variable 'escale' will be present in 'SFOs'
# if it didnt, only variable 'energy' will be present
Expand Down
14 changes: 2 additions & 12 deletions TCutility/results/dftb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,8 @@ def get_calc_settings(info: Result) -> Result:
reader_ams = cache.get(info.files['ams.rkf'])

Check failure on line 13 in TCutility/results/dftb.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (F841)

TCutility/results/dftb.py:13:5: F841 Local variable `reader_ams` is assigned to but never used
ret = Result()

# get the run type of the calculation
# read and split user input into words
user_input = str(reader_ams.read('General', 'user input')).strip()
words = user_input.split()

# default task is SinglePoint
ret.task = 'SinglePoint'
for i, word in enumerate(words):
# task is always given with the task keyword
if word.lower() == 'task':
ret.task = words[i+1]
break
# set the calculation task at a higher level
ret.task = info.input.task

# read properties of the calculation
number_of_properties = int(reader_dftb.read('Properties', 'nEntries')) # type: ignore plams does not include type hints. Returns int
Expand Down

0 comments on commit 0a36830

Please sign in to comment.