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

generic ReadFile method #6

Open
corinwagen opened this issue Feb 15, 2023 · 0 comments
Open

generic ReadFile method #6

corinwagen opened this issue Feb 15, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@corinwagen
Copy link
Collaborator

Right now if you want to write a script that reads in a variety of file types (e.g. Gaussian, Orca, etc), you have to do so in a loop:

mol = None
if filename.endswith(".inp"):
    mol = cctk.OrcaFile.read_file(filename).get_molecule()
elif filename.endswith(".gjf"):
    mol = cctk.GaussianFile.read_file(filename).get_molecule()
elif condition
    ...

It might be nice to write a function which simply takes in a file, tries all the methods (semi-intelligently), and then returns an object. Maybe you could choose between a method which always returns a File object and a method which always returns a Molecule object, reusing the same internals.

@corinwagen corinwagen added enhancement New feature or request good first issue Good for newcomers labels Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant