Skip to content

Commit

Permalink
Implement reading cube files from a content string (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha authored Nov 21, 2024
1 parent 04d5cd7 commit 7a38c6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cubehandler/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ def from_file(cls, filepath, read_data=True):
c = cls.from_file_handle(f, read_data=read_data)
return c

@classmethod
def from_content(cls, content, read_data=True):
return cls.from_file_handle(io.StringIO(content), read_data=read_data)

def write_cube_file(self, filename, low_precision=False):

natoms = len(self.ase_atoms)
Expand Down

0 comments on commit 7a38c6c

Please sign in to comment.