Skip to content

Missing Numpy imports in tpl #84

Description

@Mazzz-zzz

Some template files (e.g., ase_gauss_ts_search.tpl.py) are missing the required numpy import while using numpy data types. This causes runtime errors when the templates are used to generate Python scripts.

Example of my affected code in an insertion reaction:

# Current template without numpy import
mol = Atoms(symbols=[np.str_('F'), np.str_('C'), np.str_('O'), np.str_('F')], 
           positions=[[np.float64(1.0606767417475949), np.float64(-0.6842796201860959), np.float64(0.23015213129608103)], 
                     [np.float64(0.027390810856530563), np.float64(0.06808482357487021), np.float64(-0.12572072070705662)], 
                     [np.float64(-0.017124972467181577), np.float64(1.2691217889724777), np.float64(0.08517011050734044)], 
                     [np.float64(-1.080942445487041), np.float64(-0.6621618823478098), np.float64(0.19830547746315985)]])

The template uses numpy types (np.str_ and np.float64) for atomic symbols and positions, but lacks the necessary import numpy as np statement at the top of the file.

Proposed fix:
Add import numpy as np at the beginning of affected template files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions