io¶
Bindings for utility::io namespace
- class pyrosetta.rosetta.utility.io.FileContentsMap¶
Bases:
pybind11_object
The %FileContentsMap is a class that will minimize the number of times files are accessed from disk. The first time the contents of a file are requested, it will cache the contents the file in memory as a strings. All subsequent requests for the contents of that file will then be delivered without having to go to disk. WARNING: The %FileContentsMap will not update the contents that it holds for a file after the first time it loads it, so if the contents change on disk, the %FileContentsMap will be out of date.
The %FileContentsMap offers two settings that are both off by default.
1) You can set whether it should delete files when they reach a “read limit,” which in turn requires that you first define a read limit for the file. This can prevent the %FileContentsMap from loading too much into memory as long as the utility of a file is expected to be short (i.e. it’s read several times in a short period and then never again). Setting a file’s read limit to zero signals that the contents of the file should never be deleted from memory i.e. that it has an infinite read limit. If the contents of a file is requested before read limit has been set, then the read limit is set to zero (i.e. infinity).
2) You can set whether it should refuse to load unexpected files. Before you request the contents of a file, you must provide a read limit (zero is an acceptible value here; see above) for that file, or the %FileContentsMap will throw an exception when you request that file.
- assign(self: pyrosetta.rosetta.utility.io.FileContentsMap, : pyrosetta.rosetta.utility.io.FileContentsMap) pyrosetta.rosetta.utility.io.FileContentsMap ¶
C++: utility::io::FileContentsMap::operator=(const class utility::io::FileContentsMap &) –> class utility::io::FileContentsMap &
- clear(self: pyrosetta.rosetta.utility.io.FileContentsMap) None ¶
Delete the contents of all files and file-read counts from memory
C++: utility::io::FileContentsMap::clear() –> void
- delete_contents_at_nread_limit(*args, **kwargs)¶
Overloaded function.
delete_contents_at_nread_limit(self: pyrosetta.rosetta.utility.io.FileContentsMap, setting: bool) -> None
- Enable or disable the behavior that the %FileContentsMap will delete
the contents of files from memory after they have been read as many times as they were expected to be read (their read limit).
C++: utility::io::FileContentsMap::delete_contents_at_nread_limit(bool) –> void
delete_contents_at_nread_limit(self: pyrosetta.rosetta.utility.io.FileContentsMap) -> bool
- Return the boolean value describing whether the %FileContentsMap will
delete the contents of files from memory after they have reached their read limit.
C++: utility::io::FileContentsMap::delete_contents_at_nread_limit() const –> bool
- delete_file_contents(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) None ¶
Delete the contents of a particular file from memory
C++: utility::io::FileContentsMap::delete_file_contents(const std::string &) –> void
- get_file_contents(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) str ¶
- Return the string contents of a file, possibly loading the contents of that file
into memory for the first time, always updating internal data, and possibly deleting the contents of a file if it is expected to no longer be needed.
C++: utility::io::FileContentsMap::get_file_contents(const std::string &) –> std::string
- get_file_contents_ref(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) str ¶
- Return a reference to the string contents of a file, possibly loading the contents
of that file into memory for the first time, but not deleting the contents of that file.
C++: utility::io::FileContentsMap::get_file_contents_ref(const std::string &) –> const std::string &
- has_file_contents(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) bool ¶
Return whether or not the %FileContentsMap has the contents of a file in memory
C++: utility::io::FileContentsMap::has_file_contents(const std::string &) const –> bool
- has_read_limit_for_file(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) bool ¶
Return whether a read limit (even one of zero) has been set for a file
C++: utility::io::FileContentsMap::has_read_limit_for_file(const std::string &) const –> bool
- increment_nread_limit(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) None ¶
Increment the internal nread limit for a file
C++: utility::io::FileContentsMap::increment_nread_limit(const std::string &) –> void
- nread_limit_for_file(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) int ¶
- Return the read limit that has been set for this file; this will return
a value of zero even if the file has not had a read limit set. Use has_read_limit to determine if a read limit has been set for a particular file.
C++: utility::io::FileContentsMap::nread_limit_for_file(const std::string &) const –> unsigned long
- nreads_for_file(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str) int ¶
Return the number of times a particular file has been read
C++: utility::io::FileContentsMap::nreads_for_file(const std::string &) const –> unsigned long
- refuse_unexpected_files(*args, **kwargs)¶
Overloaded function.
refuse_unexpected_files(self: pyrosetta.rosetta.utility.io.FileContentsMap, setting: bool) -> None
- Enable or disable the behavior that the FCM will refuse to load a file if
a non-zero expected number of reads for that file has not been previously provided.
C++: utility::io::FileContentsMap::refuse_unexpected_files(bool) –> void
refuse_unexpected_files(self: pyrosetta.rosetta.utility.io.FileContentsMap) -> bool
- Return the boolean value describing whether the %FileContentsMap will refuse
to load files that it does not expect to load.
C++: utility::io::FileContentsMap::refuse_unexpected_files() const –> bool
- set_file_contents(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str, contents: str) None ¶
- Set the contents of a file from an input string thereby avoiding a read from
disk.
C++: utility::io::FileContentsMap::set_file_contents(const std::string &, const std::string &) –> void
- set_nread_limit_for_file(self: pyrosetta.rosetta.utility.io.FileContentsMap, fname: str, limit: int) None ¶
- Set the maximum number of reads for a file; if this is zero, then that
file can be read an indefinite number of times.
C++: utility::io::FileContentsMap::set_nread_limit_for_file(const std::string &, unsigned long) –> void
- class pyrosetta.rosetta.utility.io.GeneralFileContents¶
Bases:
pybind11_object
- assign(self: pyrosetta.rosetta.utility.io.GeneralFileContents, : pyrosetta.rosetta.utility.io.GeneralFileContents) pyrosetta.rosetta.utility.io.GeneralFileContents ¶
C++: utility::io::GeneralFileContents::operator=(const class utility::io::GeneralFileContents &) –> class utility::io::GeneralFileContents &
- clone(self: pyrosetta.rosetta.utility.io.GeneralFileContents) pyrosetta.rosetta.utility.io.GeneralFileContents ¶
Clone function: make a copy of this object and return an owning pointer to the copy.
C++: utility::io::GeneralFileContents::clone() const –> class std::shared_ptr<class utility::io::GeneralFileContents>
- get_file_contents(self: pyrosetta.rosetta.utility.io.GeneralFileContents) str ¶
C++: utility::io::GeneralFileContents::get_file_contents() const –> const std::string &
- class pyrosetta.rosetta.utility.io.GeneralFileContentsVector¶
Bases:
pybind11_object
- assign(self: pyrosetta.rosetta.utility.io.GeneralFileContentsVector, : pyrosetta.rosetta.utility.io.GeneralFileContentsVector) pyrosetta.rosetta.utility.io.GeneralFileContentsVector ¶
C++: utility::io::GeneralFileContentsVector::operator=(const class utility::io::GeneralFileContentsVector &) –> class utility::io::GeneralFileContentsVector &
- clone(self: pyrosetta.rosetta.utility.io.GeneralFileContentsVector) pyrosetta.rosetta.utility.io.GeneralFileContentsVector ¶
Clone function: make a copy of this object and return an owning pointer to the copy.
C++: utility::io::GeneralFileContentsVector::clone() const –> class std::shared_ptr<class utility::io::GeneralFileContentsVector>
- get_file_contents(self: pyrosetta.rosetta.utility.io.GeneralFileContentsVector) pyrosetta.rosetta.utility.vector1_std_string ¶
C++: utility::io::GeneralFileContentsVector::get_file_contents() const –> const class utility::vector1<std::string, class std::allocator<std::string > > &
- class pyrosetta.rosetta.utility.io.GeneralFileManager¶
Bases:
SingletonBase_utility_io_GeneralFileManager_t
- get_file_contents(self: pyrosetta.rosetta.utility.io.GeneralFileManager, filename: str) str ¶
Get a weights file. Load it from disk if it has not already been loaded.
Threadsafe and lazily loaded.
C++: utility::io::GeneralFileManager::get_file_contents(const std::string &) const –> const std::string &
- static get_instance() utility::io::GeneralFileManager ¶
C++: utility::SingletonBase<utility::io::GeneralFileManager>::get_instance() –> class utility::io::GeneralFileManager *
- class pyrosetta.rosetta.utility.io.GeneralFileManagerVector¶
Bases:
SingletonBase_utility_io_GeneralFileManagerVector_t
- get_file_contents(self: pyrosetta.rosetta.utility.io.GeneralFileManagerVector, filename: str) pyrosetta.rosetta.utility.vector1_std_string ¶
Get a vector of file contents. Load it from disk if it has not already been loaded.
Threadsafe and lazily loaded.
C++: utility::io::GeneralFileManagerVector::get_file_contents(const std::string &) const –> const class utility::vector1<std::string, class std::allocator<std::string > > &
- static get_instance() utility::io::GeneralFileManagerVector ¶
C++: utility::SingletonBase<utility::io::GeneralFileManagerVector>::get_instance() –> class utility::io::GeneralFileManagerVector *
- pyrosetta.rosetta.utility.io.base64_decode(s: str) str ¶
C++: utility::io::base64_decode(const std::string &) –> std::string
- pyrosetta.rosetta.utility.io.base64_encode(: int, len: int) str ¶
C++: utility::io::base64_encode(const unsigned char *, unsigned int) –> std::string
- pyrosetta.rosetta.utility.io.get_lines_from_file_data(filename: str) pyrosetta.rosetta.utility.vector1_std_string ¶
General method that opens a file and returns its data as a list of lines after checking for errors.
C++: utility::io::get_lines_from_file_data(const std::string &) –> class utility::vector1<std::string, class std::allocator<std::string > >
- pyrosetta.rosetta.utility.io.getline(*args, **kwargs)¶
Overloaded function.
getline(stream: pyrosetta.rosetta.utility.io.izstream, line: str) -> pyrosetta.rosetta.utility.io.izstream
std::getline( std::istream, std::string ) wrapper
C++: utility::io::getline(class utility::io::izstream &, std::string &) –> class utility::io::izstream &
getline(stream: pyrosetta.rosetta.utility.io.izstream, line: str, delim: str) -> pyrosetta.rosetta.utility.io.izstream
std::getline( std::istream, std::string, char ) wrapper
C++: utility::io::getline(class utility::io::izstream &, std::string &, const char) –> class utility::io::izstream &
- class pyrosetta.rosetta.utility.io.icstream¶
Bases:
irstream
icstream: Input channel stream wrapper class
- bad(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
Bad?
C++: utility::io::icstream::bad() const –> bool
- clear(self: pyrosetta.rosetta.utility.io.icstream) None ¶
Clear the stream
C++: utility::io::icstream::clear() –> void
- compressed(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
Compressed?
C++: utility::io::icstream::compressed() const –> bool
- eof(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
End of file?
C++: utility::io::icstream::eof() const –> bool
- fail(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
Fail?
C++: utility::io::icstream::fail() const –> bool
- get(*args, **kwargs)¶
Overloaded function.
get(self: pyrosetta.rosetta.utility.io.icstream) -> int
Get the next character
C++: utility::io::icstream::get() –> int
get(self: pyrosetta.rosetta.utility.io.icstream, c: str) -> pyrosetta.rosetta.utility.io.icstream
Get the next character
C++: utility::io::icstream::get(char &) –> class utility::io::icstream &
get(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.icstream
Get the next specified number of characters
C++: utility::io::icstream::get(char *, const long) –> class utility::io::icstream &
get(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.icstream
Get the next specified number of characters
C++: utility::io::icstream::get(char *, const long, const char) –> class utility::io::icstream &
get(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.icstream
Get the next specified number of characters
C++: utility::io::icstream::get(std::string &, const long) –> class utility::io::icstream &
get(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.icstream
Get the next specified number of characters
C++: utility::io::icstream::get(std::string &, const long, const char) –> class utility::io::icstream &
- getline(*args, **kwargs)¶
Overloaded function.
getline(self: pyrosetta.rosetta.utility.io.icstream, line: str, count: int) -> pyrosetta.rosetta.utility.io.icstream
Get the rest of the line
C++: utility::io::icstream::getline(char *, const long) –> class utility::io::icstream &
getline(self: pyrosetta.rosetta.utility.io.icstream, line: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.icstream
Get the rest of the line
C++: utility::io::icstream::getline(char *, const long, const char) –> class utility::io::icstream &
getline(self: pyrosetta.rosetta.utility.io.icstream, line: str) -> pyrosetta.rosetta.utility.io.icstream
Get the rest of the line
C++: utility::io::icstream::getline(std::string &) –> class utility::io::icstream &
getline(self: pyrosetta.rosetta.utility.io.icstream, line: str, delim: str) -> pyrosetta.rosetta.utility.io.icstream
Get the rest of the line
C++: utility::io::icstream::getline(std::string &, const char) –> class utility::io::icstream &
- good(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
Good?
C++: utility::io::icstream::good() const –> bool
- gzipped(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
gzipped?
C++: utility::io::icstream::gzipped() const –> bool
- ignore(*args, **kwargs)¶
Overloaded function.
ignore(self: pyrosetta.rosetta.utility.io.icstream) -> pyrosetta.rosetta.utility.io.icstream
Skip over the next character
C++: utility::io::icstream::ignore() –> class utility::io::icstream &
ignore(self: pyrosetta.rosetta.utility.io.icstream, count: int) -> pyrosetta.rosetta.utility.io.icstream
Skip over the next specified number of characters
C++: utility::io::icstream::ignore(const long) –> class utility::io::icstream &
ignore(self: pyrosetta.rosetta.utility.io.icstream, count: int, delim: str) -> pyrosetta.rosetta.utility.io.icstream
Skip over the next specified number of characters
C++: utility::io::icstream::ignore(const long, const char) –> class utility::io::icstream &
- peek(self: pyrosetta.rosetta.utility.io.icstream) int ¶
Returns the next character without extracting it
C++: utility::io::icstream::peek() –> int
- putback(self: pyrosetta.rosetta.utility.io.icstream, c: str) pyrosetta.rosetta.utility.io.icstream ¶
Put the last character read back into the stream and check that passed character is correct
C++: utility::io::icstream::putback(char) –> class utility::io::icstream &
- rdbuf(self: pyrosetta.rosetta.utility.io.icstream) pyrosetta.rosetta.std.streambuf ¶
Pointer to the stream buffer
C++: utility::io::icstream::rdbuf() const –> class std::basic_streambuf<char> *
- read(*args, **kwargs)¶
Overloaded function.
read(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.icstream
Read the next specified number of characters
C++: utility::io::icstream::read(char *, const long) –> class utility::io::icstream &
read(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.icstream
Read the next specified number of characters
C++: utility::io::icstream::read(std::string &, const long) –> class utility::io::icstream &
- readsome(*args, **kwargs)¶
Overloaded function.
readsome(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int) -> int
Read the next available specified number of characters
C++: utility::io::icstream::readsome(char *, const long) –> long
readsome(self: pyrosetta.rosetta.utility.io.icstream, str: str, count: int) -> int
Read the next available specified number of characters
C++: utility::io::icstream::readsome(std::string &, const long) –> long
- seek_beg(self: pyrosetta.rosetta.utility.io.icstream) None ¶
Seek to the beginning
C++: utility::io::icstream::seek_beg() –> void
- stream(self: pyrosetta.rosetta.utility.io.icstream) pyrosetta.rosetta.std.istream ¶
Stream access
C++: utility::io::icstream::stream() –> std::istream &
- uncompressed(self: pyrosetta.rosetta.utility.io.icstream) bool ¶
Uncompressed?
C++: utility::io::icstream::uncompressed() const –> bool
- unget(self: pyrosetta.rosetta.utility.io.icstream) pyrosetta.rosetta.utility.io.icstream ¶
Put the last character read back into the stream
C++: utility::io::icstream::unget() –> class utility::io::icstream &
- class pyrosetta.rosetta.utility.io.irstream¶
Bases:
pybind11_object
orstream: Input stream wrapper abstract base class
- bad(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
Bad?
C++: utility::io::irstream::bad() const –> bool
- clear(self: pyrosetta.rosetta.utility.io.irstream) None ¶
Clear the stream
C++: utility::io::irstream::clear() –> void
- compressed(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
Compressed?
C++: utility::io::irstream::compressed() const –> bool
- eof(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
End of file?
C++: utility::io::irstream::eof() const –> bool
- fail(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
Fail?
C++: utility::io::irstream::fail() const –> bool
- get(*args, **kwargs)¶
Overloaded function.
get(self: pyrosetta.rosetta.utility.io.irstream) -> int
Get the next character
C++: utility::io::irstream::get() –> int
get(self: pyrosetta.rosetta.utility.io.irstream, c: str) -> pyrosetta.rosetta.utility.io.irstream
Get the next character
C++: utility::io::irstream::get(char &) –> class utility::io::irstream &
get(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.irstream
Get the next specified number of characters
C++: utility::io::irstream::get(char *, const long) –> class utility::io::irstream &
get(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.irstream
Get the next specified number of characters
C++: utility::io::irstream::get(char *, const long, const char) –> class utility::io::irstream &
get(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.irstream
Get the next specified number of characters
C++: utility::io::irstream::get(std::string &, const long) –> class utility::io::irstream &
get(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.irstream
Get the next specified number of characters
C++: utility::io::irstream::get(std::string &, const long, const char) –> class utility::io::irstream &
- getline(*args, **kwargs)¶
Overloaded function.
getline(self: pyrosetta.rosetta.utility.io.irstream, line: str, count: int) -> pyrosetta.rosetta.utility.io.irstream
Get the rest of the line
C++: utility::io::irstream::getline(char *, const long) –> class utility::io::irstream &
getline(self: pyrosetta.rosetta.utility.io.irstream, line: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.irstream
Get the rest of the line
C++: utility::io::irstream::getline(char *, const long, const char) –> class utility::io::irstream &
getline(self: pyrosetta.rosetta.utility.io.irstream, line: str) -> pyrosetta.rosetta.utility.io.irstream
Get the rest of the line
C++: utility::io::irstream::getline(std::string &) –> class utility::io::irstream &
getline(self: pyrosetta.rosetta.utility.io.irstream, line: str, delim: str) -> pyrosetta.rosetta.utility.io.irstream
Get the rest of the line
C++: utility::io::irstream::getline(std::string &, const char) –> class utility::io::irstream &
- good(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
Good?
C++: utility::io::irstream::good() const –> bool
- gzipped(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
gzipped?
C++: utility::io::irstream::gzipped() const –> bool
- ignore(*args, **kwargs)¶
Overloaded function.
ignore(self: pyrosetta.rosetta.utility.io.irstream) -> pyrosetta.rosetta.utility.io.irstream
Skip over the next character
C++: utility::io::irstream::ignore() –> class utility::io::irstream &
ignore(self: pyrosetta.rosetta.utility.io.irstream, count: int) -> pyrosetta.rosetta.utility.io.irstream
Skip over the next specified number of characters
C++: utility::io::irstream::ignore(const long) –> class utility::io::irstream &
ignore(self: pyrosetta.rosetta.utility.io.irstream, count: int, delim: str) -> pyrosetta.rosetta.utility.io.irstream
Skip over the next specified number of characters
C++: utility::io::irstream::ignore(const long, const char) –> class utility::io::irstream &
- peek(self: pyrosetta.rosetta.utility.io.irstream) int ¶
Returns the next character without extracting it
C++: utility::io::irstream::peek() –> int
- putback(self: pyrosetta.rosetta.utility.io.irstream, c: str) pyrosetta.rosetta.utility.io.irstream ¶
Put the last character read back into the stream and check that passed character is correct
C++: utility::io::irstream::putback(char) –> class utility::io::irstream &
- rdbuf(self: pyrosetta.rosetta.utility.io.irstream) pyrosetta.rosetta.std.streambuf ¶
Pointer to the stream buffer
C++: utility::io::irstream::rdbuf() const –> class std::basic_streambuf<char> *
- read(*args, **kwargs)¶
Overloaded function.
read(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.irstream
Read the next specified number of characters
C++: utility::io::irstream::read(char *, const long) –> class utility::io::irstream &
read(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.irstream
Read the next specified number of characters
C++: utility::io::irstream::read(std::string &, const long) –> class utility::io::irstream &
- readsome(*args, **kwargs)¶
Overloaded function.
readsome(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int) -> int
Read the next available specified number of characters
C++: utility::io::irstream::readsome(char *, const long) –> long
readsome(self: pyrosetta.rosetta.utility.io.irstream, str: str, count: int) -> int
Read the next available specified number of characters
C++: utility::io::irstream::readsome(std::string &, const long) –> long
- seek_beg(self: pyrosetta.rosetta.utility.io.irstream) None ¶
Seek to the beginning
C++: utility::io::irstream::seek_beg() –> void
- stream(self: pyrosetta.rosetta.utility.io.irstream) pyrosetta.rosetta.std.istream ¶
Stream access
C++: utility::io::irstream::stream() –> std::istream &
- uncompressed(self: pyrosetta.rosetta.utility.io.irstream) bool ¶
Uncompressed?
C++: utility::io::irstream::uncompressed() const –> bool
- unget(self: pyrosetta.rosetta.utility.io.irstream) pyrosetta.rosetta.utility.io.irstream ¶
Put the last character read back into the stream
C++: utility::io::irstream::unget() –> class utility::io::irstream &
- class pyrosetta.rosetta.utility.io.izstream¶
Bases:
irstream
izstream: Input file stream wrapper for uncompressed and compressed files
- bad(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
Bad?
C++: utility::io::izstream::bad() const –> bool
- clear(self: pyrosetta.rosetta.utility.io.izstream) None ¶
Clear the stream(s)
C++: utility::io::izstream::clear() –> void
- close(self: pyrosetta.rosetta.utility.io.izstream) None ¶
Close the ifstream and reset the state
C++: utility::io::izstream::close() –> void
- compressed(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
Compressed?
C++: utility::io::izstream::compressed() const –> bool
- eof(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
End of file?
C++: utility::io::izstream::eof() const –> bool
- fail(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
Fail?
C++: utility::io::izstream::fail() const –> bool
- filename(self: pyrosetta.rosetta.utility.io.izstream) str ¶
File name
C++: utility::io::izstream::filename() const –> const std::string &
- gcount(self: pyrosetta.rosetta.utility.io.izstream) int ¶
Get the number of characters read by the last unformatted read
C++: utility::io::izstream::gcount() const –> long
- get(*args, **kwargs)¶
Overloaded function.
get(self: pyrosetta.rosetta.utility.io.izstream) -> int
Get the next character
C++: utility::io::izstream::get() –> int
get(self: pyrosetta.rosetta.utility.io.izstream, c: str) -> pyrosetta.rosetta.utility.io.izstream
Get the next character
C++: utility::io::izstream::get(char &) –> class utility::io::izstream &
get(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.izstream
Get the next specified number of characters
C++: utility::io::izstream::get(char *, const long) –> class utility::io::izstream &
get(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.izstream
Get the next specified number of characters
C++: utility::io::izstream::get(char *, const long, const char) –> class utility::io::izstream &
get(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.izstream
Get the next specified number of characters
C++: utility::io::izstream::get(std::string &, const long) –> class utility::io::izstream &
get(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.izstream
Get the next specified number of characters
C++: utility::io::izstream::get(std::string &, const long, const char) –> class utility::io::izstream &
- static get_alternative_search_paths() pyrosetta.rosetta.utility.vector1_std_string ¶
C++: utility::io::izstream::get_alternative_search_paths() –> class utility::vector1<std::string, class std::allocator<std::string > >
- getline(*args, **kwargs)¶
Overloaded function.
getline(self: pyrosetta.rosetta.utility.io.izstream, line: str, count: int) -> pyrosetta.rosetta.utility.io.izstream
Get the rest of the line
C++: utility::io::izstream::getline(char *, const long) –> class utility::io::izstream &
getline(self: pyrosetta.rosetta.utility.io.izstream, line: str, count: int, delim: str) -> pyrosetta.rosetta.utility.io.izstream
Get the rest of the line
C++: utility::io::izstream::getline(char *, const long, const char) –> class utility::io::izstream &
getline(self: pyrosetta.rosetta.utility.io.izstream, line: str) -> pyrosetta.rosetta.utility.io.izstream
Get the rest of the line
C++: utility::io::izstream::getline(std::string &) –> class utility::io::izstream &
getline(self: pyrosetta.rosetta.utility.io.izstream, line: str, delim: str) -> pyrosetta.rosetta.utility.io.izstream
Get the rest of the line
C++: utility::io::izstream::getline(std::string &, const char) –> class utility::io::izstream &
- good(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
Good?
C++: utility::io::izstream::good() const –> bool
- gzipped(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
gzipped?
C++: utility::io::izstream::gzipped() const –> bool
- ignore(*args, **kwargs)¶
Overloaded function.
ignore(self: pyrosetta.rosetta.utility.io.izstream) -> pyrosetta.rosetta.utility.io.izstream
Skip over the next character
C++: utility::io::izstream::ignore() –> class utility::io::izstream &
ignore(self: pyrosetta.rosetta.utility.io.izstream, count: int) -> pyrosetta.rosetta.utility.io.izstream
Skip over the next specified number of characters
C++: utility::io::izstream::ignore(const long) –> class utility::io::izstream &
ignore(self: pyrosetta.rosetta.utility.io.izstream, count: int, delim: str) -> pyrosetta.rosetta.utility.io.izstream
Skip over the next specified number of characters
C++: utility::io::izstream::ignore(const long, const char) –> class utility::io::izstream &
- open(*args, **kwargs)¶
Overloaded function.
open(self: pyrosetta.rosetta.utility.io.izstream, filename_a: str) -> None
open(self: pyrosetta.rosetta.utility.io.izstream, filename_a: str, open_mode: std::_Ios_Openmode) -> None
Open a file
C++: utility::io::izstream::open(const std::string &, enum std::_Ios_Openmode) –> void
- peek(self: pyrosetta.rosetta.utility.io.izstream) int ¶
Returns the next character without extracting it
C++: utility::io::izstream::peek() –> int
- putback(self: pyrosetta.rosetta.utility.io.izstream, c: str) pyrosetta.rosetta.utility.io.izstream ¶
- Put the last character read back into the stream and check
that passed character is correct
C++: utility::io::izstream::putback(char) –> class utility::io::izstream &
- rdbuf(self: pyrosetta.rosetta.utility.io.izstream) pyrosetta.rosetta.std.streambuf ¶
Pointer to the stream buffer
C++: utility::io::izstream::rdbuf() const –> class std::basic_streambuf<char> *
- read(*args, **kwargs)¶
Overloaded function.
read(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.izstream
Read the next specified number of characters
C++: utility::io::izstream::read(char *, const long) –> class utility::io::izstream &
read(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.izstream
Read the next specified number of characters
C++: utility::io::izstream::read(std::string &, const long) –> class utility::io::izstream &
- readsome(*args, **kwargs)¶
Overloaded function.
readsome(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int) -> int
Read the next available specified number of characters
C++: utility::io::izstream::readsome(char *, const long) –> long
readsome(self: pyrosetta.rosetta.utility.io.izstream, str: str, count: int) -> int
Read the next available specified number of characters
C++: utility::io::izstream::readsome(std::string &, const long) –> long
- seek_beg(self: pyrosetta.rosetta.utility.io.izstream) None ¶
Seek to the beginning
C++: utility::io::izstream::seek_beg() –> void
- static set_alternative_search_paths(alternative_search_paths: pyrosetta.rosetta.utility.vector1_std_string) None ¶
C++: utility::io::izstream::set_alternative_search_paths(class utility::vector1<std::string, class std::allocator<std::string > >) –> void
- stream(self: pyrosetta.rosetta.utility.io.izstream) pyrosetta.rosetta.std.istream ¶
Stream access
C++: utility::io::izstream::stream() –> std::istream &
- uncompressed(self: pyrosetta.rosetta.utility.io.izstream) bool ¶
Uncompressed?
C++: utility::io::izstream::uncompressed() const –> bool
- unget(self: pyrosetta.rosetta.utility.io.izstream) pyrosetta.rosetta.utility.io.izstream ¶
Put the last character read back into the stream
C++: utility::io::izstream::unget() –> class utility::io::izstream &
- class pyrosetta.rosetta.utility.io.ocstream¶
Bases:
orstream
ocstream: Output channel stream wrapper class
- bad(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
Bad?
C++: utility::io::ocstream::bad() const –> bool
- clear(self: pyrosetta.rosetta.utility.io.ocstream) None ¶
Clear the stream
C++: utility::io::ocstream::clear() –> void
- compressed(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
Compressed?
C++: utility::io::ocstream::compressed() const –> bool
- eof(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
End of file?
C++: utility::io::ocstream::eof() const –> bool
- fail(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
Fail?
C++: utility::io::ocstream::fail() const –> bool
- flush(self: pyrosetta.rosetta.utility.io.ocstream) pyrosetta.rosetta.utility.io.ocstream ¶
Flush the stream
C++: utility::io::ocstream::flush() –> class utility::io::ocstream &
- good(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
Good?
C++: utility::io::ocstream::good() const –> bool
- gzipped(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
gzipped?
C++: utility::io::ocstream::gzipped() const –> bool
- put(self: pyrosetta.rosetta.utility.io.ocstream, c: str) pyrosetta.rosetta.utility.io.ocstream ¶
Write a char
C++: utility::io::ocstream::put(const char) –> class utility::io::ocstream &
- rdbuf(self: pyrosetta.rosetta.utility.io.ocstream) pyrosetta.rosetta.std.streambuf ¶
Pointer to the stream buffer
C++: utility::io::ocstream::rdbuf() const –> class std::basic_streambuf<char> *
- stream(self: pyrosetta.rosetta.utility.io.ocstream) pyrosetta.rosetta.std.ostream ¶
Stream access
C++: utility::io::ocstream::stream() –> std::ostream &
- uncompressed(self: pyrosetta.rosetta.utility.io.ocstream) bool ¶
Uncompressed?
C++: utility::io::ocstream::uncompressed() const –> bool
- write(*args, **kwargs)¶
Overloaded function.
write(self: pyrosetta.rosetta.utility.io.ocstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.ocstream
Write a string
C++: utility::io::ocstream::write(const char *, const long) –> class utility::io::ocstream &
write(self: pyrosetta.rosetta.utility.io.ocstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.ocstream
Write a string
C++: utility::io::ocstream::write(const std::string &, const long) –> class utility::io::ocstream &
- class pyrosetta.rosetta.utility.io.orstream¶
Bases:
pybind11_object
orstream: Output stream wrapper base class
- bad(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
Bad?
C++: utility::io::orstream::bad() const –> bool
- clear(self: pyrosetta.rosetta.utility.io.orstream) None ¶
Clear the stream
C++: utility::io::orstream::clear() –> void
- compressed(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
Compressed?
C++: utility::io::orstream::compressed() const –> bool
- eof(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
End of file?
C++: utility::io::orstream::eof() const –> bool
- fail(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
Fail?
C++: utility::io::orstream::fail() const –> bool
- flush(self: pyrosetta.rosetta.utility.io.orstream) pyrosetta.rosetta.utility.io.orstream ¶
Flush the stream
C++: utility::io::orstream::flush() –> class utility::io::orstream &
- good(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
Good?
C++: utility::io::orstream::good() const –> bool
- gzipped(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
gzipped?
C++: utility::io::orstream::gzipped() const –> bool
- put(self: pyrosetta.rosetta.utility.io.orstream, c: str) pyrosetta.rosetta.utility.io.orstream ¶
Write a char
C++: utility::io::orstream::put(const char) –> class utility::io::orstream &
- rdbuf(self: pyrosetta.rosetta.utility.io.orstream) pyrosetta.rosetta.std.streambuf ¶
Pointer to the stream buffer
C++: utility::io::orstream::rdbuf() const –> class std::basic_streambuf<char> *
- stream(self: pyrosetta.rosetta.utility.io.orstream) pyrosetta.rosetta.std.ostream ¶
Stream access
C++: utility::io::orstream::stream() –> std::ostream &
- uncompressed(self: pyrosetta.rosetta.utility.io.orstream) bool ¶
Uncompressed?
C++: utility::io::orstream::uncompressed() const –> bool
- write(*args, **kwargs)¶
Overloaded function.
write(self: pyrosetta.rosetta.utility.io.orstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.orstream
Write a string
C++: utility::io::orstream::write(const char *, const long) –> class utility::io::orstream &
write(self: pyrosetta.rosetta.utility.io.orstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.orstream
Write a string
C++: utility::io::orstream::write(const std::string &, const long) –> class utility::io::orstream &
- class pyrosetta.rosetta.utility.io.ozstream¶
Bases:
orstream
ozstream: Output file stream wrapper for uncompressed and compressed files
- static MPI_reroute_rank() int ¶
C++: utility::io::ozstream::MPI_reroute_rank() –> int
- bad(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
Bad?
C++: utility::io::ozstream::bad() const –> bool
- buffer_size(*args, **kwargs)¶
Overloaded function.
buffer_size(self: pyrosetta.rosetta.utility.io.ozstream) -> int
get buffer size (bytes)
- In uncompressed mode this is the size of the character buffer.
In compressed mode this is the size of the zip buffer.
C++: utility::io::ozstream::buffer_size() const –> long
buffer_size(self: pyrosetta.rosetta.utility.io.ozstream, buf_size: int) -> None
set buffer size (bytes)
- In uncompressed mode this is the size of the character buffer.
In compressed mode this is the size of the zip buffer. Lower bound of 4KB is enforced due to zipstream requirements. Operation is skipped if the file is currently open, as the buffer is considered locked.
C++: utility::io::ozstream::buffer_size(const long &) –> void
- clear(self: pyrosetta.rosetta.utility.io.ozstream) None ¶
Clear the stream
C++: utility::io::ozstream::clear() –> void
- close(self: pyrosetta.rosetta.utility.io.ozstream) None ¶
Close the ofstream and reset the state
C++: utility::io::ozstream::close() –> void
- compressed(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
Compressed?
C++: utility::io::ozstream::compressed() const –> bool
- static enable_MPI_reroute(min_client_rank: int, master_rank: int) None ¶
C++: utility::io::ozstream::enable_MPI_reroute(int, int) –> void
- eof(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
End of file?
C++: utility::io::ozstream::eof() const –> bool
- fail(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
Fail?
C++: utility::io::ozstream::fail() const –> bool
- filename(self: pyrosetta.rosetta.utility.io.ozstream) str ¶
File name
C++: utility::io::ozstream::filename() const –> const std::string &
- flush(self: pyrosetta.rosetta.utility.io.ozstream) pyrosetta.rosetta.utility.io.ozstream ¶
Flush the stream – currently alias to flush_finalize()
- Instead doing a regular flush, we currently force a
completion of the zip stream. We do this to pre-empt against several things: (1) the expensive operation of closing and re-opening a stream (2) confusion and inconvenience that may result from users calling flushes and ending upon with broken or corrupted files if a job is somehow interrupted (e.g. on a cluster). Please note that calling flush_finalize() too often can seriously degrade compression. zlib documentation appears to imply that every 1MB or so is a reasonable rule of thumb.
C++: utility::io::ozstream::flush() –> class utility::io::ozstream &
- flush_finalize(self: pyrosetta.rosetta.utility.io.ozstream) pyrosetta.rosetta.utility.io.ozstream ¶
Flush the streams and finalize the zip stream
- Calling this will complete the zip stream.
Upon the next write, a new zip stream will be started. Please note that calling flush_finalize() too often can seriously degrade compression. zlib documentation appears to imply that every 1MB or so is a reasonable rule of thumb.
C++: utility::io::ozstream::flush_finalize() –> class utility::io::ozstream &
- good(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
Good?
C++: utility::io::ozstream::good() const –> bool
- gzipped(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
gzipped?
C++: utility::io::ozstream::gzipped() const –> bool
- open(*args, **kwargs)¶
Overloaded function.
open(self: pyrosetta.rosetta.utility.io.ozstream, filename_a: str) -> None
open(self: pyrosetta.rosetta.utility.io.ozstream, filename_a: str, open_mode: std::_Ios_Openmode) -> None
Open a file
C++: utility::io::ozstream::open(const std::string &, enum std::_Ios_Openmode) –> void
- open_append(self: pyrosetta.rosetta.utility.io.ozstream, filename_a: str) None ¶
Open a text file for appending
C++: utility::io::ozstream::open_append(const std::string &) –> void
- open_append_if_existed(self: pyrosetta.rosetta.utility.io.ozstream, filename_a: str, preprinted_header: pyrosetta.rosetta.std.stringstream) None ¶
open file as append if it exists, return true if file existed before, false if it is new.
C++: utility::io::ozstream::open_append_if_existed(const std::string &, class std::basic_stringstream<char> &) –> void
- put(self: pyrosetta.rosetta.utility.io.ozstream, c: str) pyrosetta.rosetta.utility.io.ozstream ¶
Write a char
C++: utility::io::ozstream::put(const char) –> class utility::io::ozstream &
- rdbuf(self: pyrosetta.rosetta.utility.io.ozstream) pyrosetta.rosetta.std.streambuf ¶
Pointer to the stream buffer
C++: utility::io::ozstream::rdbuf() const –> class std::basic_streambuf<char> *
- stream(self: pyrosetta.rosetta.utility.io.ozstream) pyrosetta.rosetta.std.ostream ¶
Stream access
C++: utility::io::ozstream::stream() –> std::ostream &
- uncompressed(self: pyrosetta.rosetta.utility.io.ozstream) bool ¶
Uncompressed?
C++: utility::io::ozstream::uncompressed() const –> bool
- write(*args, **kwargs)¶
Overloaded function.
write(self: pyrosetta.rosetta.utility.io.ozstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.ozstream
Write a string
C++: utility::io::ozstream::write(const char *, const long) –> class utility::io::ozstream &
write(self: pyrosetta.rosetta.utility.io.ozstream, str: str, count: int) -> pyrosetta.rosetta.utility.io.ozstream
Write a string
C++: utility::io::ozstream::write(const std::string &, const long) –> class utility::io::ozstream &
- zflush(self: pyrosetta.rosetta.utility.io.ozstream) None ¶
Flush the zip_ostream
this will flush but not finalize the zip stream
C++: utility::io::ozstream::zflush() –> void
- zflush_finalize(self: pyrosetta.rosetta.utility.io.ozstream) None ¶
Flush and finalize the zip_stream
- Calling this will complete the zip stream.
Upon the next write, a new zip stream will be started Please note that calling zflush_finalize() too often can seriously degrade compression. zlib documentation appears to imply that every 1MB or so is a reasonable rule of thumb.
C++: utility::io::ozstream::zflush_finalize() –> void
- pyrosetta.rosetta.utility.io.remove_inline_comments(line: str) None ¶
General method for removing comments from a line read from a database file.
C++: utility::io::remove_inline_comments(std::string &) –> void
- pyrosetta.rosetta.utility.io.skip(*args, **kwargs)¶
Overloaded function.
skip(stream: pyrosetta.rosetta.utility.io.izstream) -> pyrosetta.rosetta.std.istream
Skip rest of line and line terminator (manipulator)
C++: utility::io::skip(class utility::io::izstream &) –> std::istream &
skip(stream: pyrosetta.rosetta.std.istream) -> pyrosetta.rosetta.std.istream
Skip rest of line and line terminator (manipulator)
C++: utility::io::skip(std::istream &) –> std::istream &