Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMG-Py v3.2.0 for review only DO NOT MERGE #2449

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For conda build
package:
name: rmg
version: 3.1.0
version: 3.2.0

source:
path: ../
Expand Down Expand Up @@ -64,7 +64,7 @@ requirements:
- pyzmq
- quantities
- rdkit >=2018
- rmgdatabase >=3.1.0
- rmgdatabase >=3.2.0
- scikit-learn
- scipy
- symmetry
Expand Down
2 changes: 1 addition & 1 deletion Arkane.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu),
Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu),
Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)

Permission is hereby granted, free of charge, to any person obtaining a
Expand Down
2 changes: 1 addition & 1 deletion arkane/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/commonTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/aeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/bac.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down Expand Up @@ -92,14 +92,14 @@
"""
self.level_of_theory = level_of_theory
self.bac_type = bac_type
self.crossval_n_folds = crossval_n_folds

Check warning on line 95 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L95

Added line #L95 was not covered by tests
self.write_to_database = write_to_database
self.overwrite = overwrite
self.kwargs = kwargs
if self.crossval_n_folds != 1:
self.bac = CrossVal(level_of_theory, bac_type=bac_type, n_folds=crossval_n_folds)

Check warning on line 100 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L100

Added line #L100 was not covered by tests
else:
self.bac = BAC(level_of_theory, bac_type=bac_type)

Check warning on line 102 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L102

Added line #L102 was not covered by tests

def execute(self, output_directory: str = None, plot: bool = False, jobnum: int = 1):
"""
Expand Down Expand Up @@ -144,11 +144,11 @@
with open(output_file1, 'a') as f:
stats_before = self.bac.dataset.calculate_stats()
stats_after = self.bac.dataset.calculate_stats(for_bac_data=True)
bac_type_str = f'{"Melius" if self.bac.bac_type == "m" else "Petersson"}-type BACs'
f.write(f'# Job {jobnum}: {bac_type_str}:\n')
f.write(f'# Training RMSE/MAE before fitting: {stats_before.rmse:.2f}/{stats_before.mae:.2f} kcal/mol\n')
f.write(f'# Training RMSE/MAE after fitting: {stats_after.rmse:.2f}/{stats_after.mae:.2f} kcal/mol\n')
f.writelines(self.bac.format_bacs(ci=True))

Check warning on line 151 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L147-L151

Added lines #L147 - L151 were not covered by tests
f.write('\n')

with open(output_file2, 'w') as f:
Expand Down Expand Up @@ -197,8 +197,8 @@

model_chemistry_formatted = self.level_of_theory.to_model_chem().replace('//', '__').replace('/', '_')
if self.crossval_n_folds == 1:
correlation_path = os.path.join(output_directory, f'{jobnum}_{model_chemistry_formatted}_correlation.pdf')
self.bac.save_correlation_mat(correlation_path)

Check warning on line 201 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L200-L201

Added lines #L200 - L201 were not covered by tests

plt.rcParams.update({'font.size': 16})
fig_path = os.path.join(output_directory, f'{jobnum}_{model_chemistry_formatted}_errors.pdf')
Expand Down Expand Up @@ -848,7 +848,7 @@
break
else:
# 'pbac' and 'mbac' should both be found at `data_path`
raise RuntimeError(f'Keyword "{keyword} is not found in the data file. '

Check warning on line 851 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L851

Added line #L851 was not covered by tests
f'Please check the database file at {data_path} and '
f'make sure an up-to-date RMG-database branch is used.')

Expand All @@ -867,13 +867,13 @@
del_idx_end = i + j + 1
if (lines[del_idx_start - 1].lstrip().startswith('#')
or lines[del_idx_end + 1].lstrip().startswith('#')):
logging.warning('There may be left over comments from previous BACs')

Check warning on line 870 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L870

Added line #L870 was not covered by tests
lines[del_idx_start:del_idx_end] = bacs_formatted
break

# Check if the entry is successfully inserted to the `lines`
if del_idx_start is None or del_idx_end is None:
raise RuntimeError(f'The script cannot identify the corresponding block for the given BACs. '

Check warning on line 876 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L876

Added line #L876 was not covered by tests
f'It is possible that the database file at {data_path} is not correctly '
f'formatted. Please check the file.')

Expand All @@ -884,8 +884,8 @@
else:
# Either empty BACs dict or adding BACs for a new level of theory
if not has_entries and '}' in lines[i]: # Empty BACs dict
lines[i] = f'{keyword} = {{\n'
lines[(i+1):(i+1)] = ['\n}\n']

Check warning on line 888 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L887-L888

Added lines #L887 - L888 were not covered by tests
lines[(i+1):(i+1)] = ['\n'] + bacs_formatted

with open(data_path if alternate_path is None else alternate_path, 'w') as f:
Expand Down Expand Up @@ -914,10 +914,10 @@
bacs_formatted = [' ' + e for e in bacs_formatted]

if ci:
ci_formatted = ['95% Confidence interval half-widths:']
ci_formatted += json.dumps(self.confidence_intervals, indent=4).replace('"', "'").split('\n')

Check warning on line 918 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L917-L918

Added lines #L917 - L918 were not covered by tests
ci_formatted = ['# ' + e + '\n' for e in ci_formatted]
bacs_formatted.extend(ci_formatted)

Check warning on line 920 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L920

Added line #L920 was not covered by tests

return bacs_formatted

Expand Down Expand Up @@ -1085,7 +1085,7 @@
n = len(y) # Ndata
p = len(x.T) # Nparam
if weights is None:
weights = np.eye(n)

Check warning on line 1088 in arkane/encorr/bac.py

View check run for this annotation

Codecov / codecov/patch

arkane/encorr/bac.py#L1088

Added line #L1088 was not covered by tests

e = y - ypred # Residuals
sigma2 = e.T @ weights @ e / (n - p) # MSE
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/bacTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/corr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/corrTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/dataTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/decomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/decompTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/isodesmic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/isodesmicTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/referenceTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down Expand Up @@ -56,7 +56,7 @@
Checks the log file for common errors.
Optionally runs when the class is initialized to catch errors before parsing relevant information.
"""
pass

Check warning on line 59 in arkane/ess/adapter.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/adapter.py#L59

Added line #L59 was not covered by tests

@abstractmethod
def get_number_of_atoms(self):
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/factoryTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down Expand Up @@ -73,22 +73,22 @@
if 'l9999.exe' in line or 'link 9999' in line:
error = 'Unconverged'
elif 'l101.exe' in line:
error = 'The blank line after the coordinate section is missing, ' \

Check warning on line 76 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L76

Added line #L76 was not covered by tests
'or charge/multiplicity was not specified correctly.'
elif 'l103.exe' in line:
error = 'Internal coordinate error'

Check warning on line 79 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L79

Added line #L79 was not covered by tests
elif 'l108.exe' in line:
error = 'There are two blank lines between z-matrix and ' \

Check warning on line 81 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L81

Added line #L81 was not covered by tests
'the variables, expected only one.'
elif 'l202.exe' in line:
error = 'During the optimization process, either the standard ' \

Check warning on line 84 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L84

Added line #L84 was not covered by tests
'orientation or the point group of the molecule has changed.'
elif 'l502.exe' in line:
error = 'Unconverged SCF.'

Check warning on line 87 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L87

Added line #L87 was not covered by tests
elif 'l716.exe' in line:
error = 'Angle in z-matrix outside the allowed range 0 < x < 180.'

Check warning on line 89 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L89

Added line #L89 was not covered by tests
elif 'l906.exe' in line:
error = 'The MP2 calculation has failed. It may be related to pseudopotential. ' \

Check warning on line 91 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L91

Added line #L91 was not covered by tests
'Basis sets (CEP-121G*) that are used with polarization functions, ' \
'where no polarization functions actually exist.'
elif 'l913.exe' in line:
Expand All @@ -100,7 +100,7 @@
# no need to continue parsing if terminated without errors
break
if not terminated:
raise LogError(f'Gaussian output file {self.path} did not terminate')

Check warning on line 103 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L103

Added line #L103 was not covered by tests

def get_number_of_atoms(self):
"""
Expand Down Expand Up @@ -330,7 +330,7 @@
elif 'E(CBS-QB3)=' in line:
# CBS-QB3 calculation without opt and freq calculation
# Keyword in Gaussian CBS-QB3(SP), No zero-point or thermal energies are included.
e_elect = float(line.split()[1]) * constants.E_h * constants.Na

Check warning on line 333 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L333

Added line #L333 was not covered by tests
elif 'CBS-4 (0 K)=' in line:
e0_composite = float(line.split()[3]) * constants.E_h * constants.Na
elif 'G3(0 K)' in line:
Expand All @@ -338,19 +338,19 @@
elif 'G3 Energy=' in line:
# G3 calculation without opt and freq calculation
# Keyword in Gaussian G3(SP), No zero-point or thermal energies are included.
e_elect = float(line.split()[2]) * constants.E_h * constants.Na

Check warning on line 341 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L341

Added line #L341 was not covered by tests
elif 'G4(0 K)' in line:
e0_composite = float(line.split()[2]) * constants.E_h * constants.Na
elif 'G4 Energy=' in line:
# G4 calculation without opt and freq calculation
# Keyword in Gaussian G4(SP), No zero-point or thermal energies are included.
e_elect = float(line.split()[2]) * constants.E_h * constants.Na

Check warning on line 347 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L347

Added line #L347 was not covered by tests
elif 'G4MP2(0 K)' in line:
e0_composite = float(line.split()[2]) * constants.E_h * constants.Na
elif 'G4MP2 Energy=' in line:
# G4MP2 calculation without opt and freq calculation
# Keyword in Gaussian G4MP2(SP), No zero-point or thermal energies are included.
e_elect = float(line.split()[2]) * constants.E_h * constants.Na

Check warning on line 353 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L353

Added line #L353 was not covered by tests

# Read the ZPE from the "E(ZPE)=" line, as this is the scaled version.
# Gaussian defines the following as
Expand Down Expand Up @@ -445,8 +445,8 @@
# In some cases, the optimization cannot converge within the given steps.
# Then, the geometry is not optimized. we need to exclude these values.
if 'Optimization stopped' in line:
non_optimized.append(len(vlist))
vlist.append(energy)

Check warning on line 449 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L448-L449

Added lines #L448 - L449 were not covered by tests
# Read the optimized angle from optimized parameters
if internal_coord in line and 'Scan' not in line:
# EXAMPLE:
Expand All @@ -457,10 +457,10 @@

# give warning in case this assumption is not true
if rigid_scan:
print(f' Assuming {os.path.basename(self.path)} is the output from a rigid scan...')

Check warning on line 460 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L460

Added line #L460 was not covered by tests
# For rigid scans, all of the angles are evenly spaced with a constant step size
scan_res = math.pi / 180 * self._load_scan_angle()
angle = np.arange(0.0, scan_res * (len(vlist) - 1) + 0.00001, scan_res, np.float64)

Check warning on line 463 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L462-L463

Added lines #L462 - L463 were not covered by tests
else:
angle = np.array(angle, np.float64)
# Convert -180 ~ 180 degrees to 0 ~ 2pi rads
Expand All @@ -485,10 +485,10 @@
angle = angle[:-1]

if non_optimized:
logging.warning(f'Scan results for angles at {angle[non_optimized]} are discarded '

Check warning on line 488 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L488

Added line #L488 was not covered by tests
f'due to non-converged optimization.')
vlist = np.delete(vlist, non_optimized)
angle = np.delete(angle, non_optimized)

Check warning on line 491 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L490-L491

Added lines #L490 - L491 were not covered by tests

return vlist, angle

Expand Down Expand Up @@ -528,8 +528,8 @@
# It defines a linear bend which is helpful in calculating
# molecules with ~180 degree bond angles. As no other module
# now depends on this information, simply skipping this line.
line = f.readline()
continue

Check warning on line 532 in arkane/ess/gaussian.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/gaussian.py#L531-L532

Added lines #L531 - L532 were not covered by tests
else:
raise LogError('This file has an option not supported by Arkane. '
'Unable to read scan specs for line: {0}'.format(line))
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/gaussianTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/molpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down Expand Up @@ -70,11 +70,11 @@
break
# check for common error messages
elif 'No convergence' in line:
error = 'Unconverged'

Check warning on line 73 in arkane/ess/molpro.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/molpro.py#L73

Added line #L73 was not covered by tests
elif 'A further' in line and 'Mwords of memory are needed' in line and 'Increase memory to' in line:
# e.g.: `A further 246.03 Mwords of memory are needed for the triples to run.
# Increase memory to 996.31 Mwords.` (w/o the line break)
error = 'Memory'

Check warning on line 77 in arkane/ess/molpro.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/molpro.py#L77

Added line #L77 was not covered by tests
elif 'insufficient memory available - require' in line:
# e.g.: `insufficient memory available - require 228765625 have
# 62928590
Expand All @@ -97,7 +97,7 @@
basis_set = None
for line0 in reversed(line):
if 'SETTING BASIS' in line0:
basis_set = line0.split()[-1]

Check warning on line 100 in arkane/ess/molpro.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/molpro.py#L100

Added line #L100 was not covered by tests
error = f'Unrecognized basis set {basis_set}'
if error:
raise LogError(f'There was an error ({error}) with Molpro output file {self.path} '
Expand Down Expand Up @@ -435,8 +435,8 @@
if len(freqs) == 1:
return -float(freqs[0])
elif len(freqs) > 1:
logging.info('More than one imaginary frequency in Molpro output file {0}.'.format(self.path))
return -float(freqs[0])

Check warning on line 439 in arkane/ess/molpro.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/molpro.py#L438-L439

Added lines #L438 - L439 were not covered by tests
else:
raise LogError('Unable to find imaginary frequency in Molpro output file {0}'.format(self.path))

Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/molproTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down Expand Up @@ -67,11 +67,11 @@
error = 'SCF'
break
elif 'ORCA finished by error termination in MDCI' in line:
error = 'MDCI'
break

Check warning on line 71 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L70-L71

Added lines #L70 - L71 were not covered by tests
elif 'Error : multiplicity' in line:
error = f'The multiplicity and charge combination for species {species_label} are wrong.'
break

Check warning on line 74 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L73-L74

Added lines #L73 - L74 were not covered by tests
elif 'ORCA TERMINATED NORMALLY' in line:
break
if error:
Expand Down Expand Up @@ -109,42 +109,42 @@
The units of the returned force constants are J/m^2.
If no force constant matrix can be found, ``None`` is returned.
"""
hess_files = list()

Check warning on line 112 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L112

Added line #L112 was not covered by tests
for (_, _, files) in os.walk(os.path.dirname(self.path)):
for file_ in files:
if file_.endswith('.hess'):
hess_files.append(file_)
break

Check warning on line 117 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L116-L117

Added lines #L116 - L117 were not covered by tests
if len(hess_files) == 1:
hess_file = hess_files[0]

Check warning on line 119 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L119

Added line #L119 was not covered by tests
else:
expected_hess_name = f"{os.path.basename(self.path).split('.')[0]}.hess"

Check warning on line 121 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L121

Added line #L121 was not covered by tests
for hess_file in hess_files:
if hess_file == expected_hess_name:
break

Check warning on line 124 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L124

Added line #L124 was not covered by tests
else:
raise LogError(f'Could not identify the intended .hess file in {os.path.dirname(self.path)}.\n'

Check warning on line 126 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L126

Added line #L126 was not covered by tests
f'Expected to find {expected_hess_name} in that folder.')

force = None
n_atoms = self.get_number_of_atoms()
n_rows = n_atoms * 3
with open(hess_file, 'r') as f:
line = f.readline()

Check warning on line 133 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L129-L133

Added lines #L129 - L133 were not covered by tests
while line != '':
if '$hessian' in line:
line = f.readline()
force = np.zeros((n_rows, n_rows), np.float64)

Check warning on line 137 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L136-L137

Added lines #L136 - L137 were not covered by tests
for i in range(int(math.ceil(n_rows / 5.0))):
line = f.readline()

Check warning on line 139 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L139

Added line #L139 was not covered by tests
for j in range(n_rows):
data = f.readline().split()[1:]

Check warning on line 141 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L141

Added line #L141 was not covered by tests
for k in range(len(data)):
force[j, i * 5 + k] = float(data[k])

Check warning on line 143 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L143

Added line #L143 was not covered by tests
# Convert from atomic units (Hartree/Bohr_radius^2) to J/m^2
force *= 4.35974417e-18 / 5.291772108e-11 ** 2
line = f.readline()
return force

Check warning on line 147 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L145-L147

Added lines #L145 - L147 were not covered by tests

def load_geometry(self):
"""
Expand Down Expand Up @@ -184,7 +184,7 @@
number = np.array(numbers, np.int)
mass = np.array(mass, np.float64)
if len(number) == 0 or len(coord) == 0 or len(mass) == 0:
raise LogError(f'Unable to read atoms from orca geometry output file {self.path}.')

Check warning on line 187 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L187

Added line #L187 was not covered by tests

return coord, number, mass

Expand Down Expand Up @@ -219,7 +219,7 @@
break
frequencies.extend([float(line_.split()[1])])
else:
raise Exception(f'Frequencies not found in {self.path}')

Check warning on line 222 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L222

Added line #L222 was not covered by tests
frequencies = [f for f in frequencies if f > 0.0]
unscaled_frequencies = frequencies
vibration = HarmonicOscillator(frequencies=(frequencies, "cm^-1"))
Expand All @@ -232,8 +232,8 @@
inertia = list(inertia[0])
if len(inertia):
if any(i == 0.0 for i in inertia):
inertia.remove(0.0)
rot.append(LinearRotor(inertia=(inertia, "amu*angstrom^2"), symmetry=symmetry))

Check warning on line 236 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L235-L236

Added lines #L235 - L236 were not covered by tests
else:
rot.append(NonlinearRotor(inertia=(inertia, "amu*angstrom^2"), symmetry=symmetry))

Expand Down Expand Up @@ -292,10 +292,10 @@
if len(frequencies) == 1:
return frequencies[0]
elif len(frequencies) > 1:
logging.info('More than one imaginary frequency in Orca output file {0}.'.format(self.path))
return frequencies[0]

Check warning on line 296 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L295-L296

Added lines #L295 - L296 were not covered by tests
else:
raise LogError(f'Unable to find imaginary frequency in Orca output file {self.path}')

Check warning on line 298 in arkane/ess/orca.py

View check run for this annotation

Codecov / codecov/patch

arkane/ess/orca.py#L298

Added line #L298 was not covered by tests

def get_T1_diagnostic(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion arkane/ess/orcaTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2021 Prof. William H. Green (whgreen@mit.edu), #
# Copyright (c) 2002-2023 Prof. William H. Green (whgreen@mit.edu), #
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
Expand Down
Loading
Loading