text stringlengths 81 112k |
|---|
Iterate through a DOCX file and yield text.
Args:
doc: DOCX document to process
config: :class:`TextProcessingConfig` control object
Yields:
pieces of text (paragraphs)
def docx_docx_gen_text(doc: DOCX_DOCUMENT_TYPE,
config: TextProcessingConfig) -> Iterator[str... |
Converts a DOCX file to text.
Pass either a filename or a binary object.
Args:
filename: filename to process
blob: binary ``bytes`` object to process
config: :class:`TextProcessingConfig` control object
Returns:
text contents
Notes:
- Old ``docx`` (https://pypi.py... |
Converts an OpenOffice ODT file to text.
Pass either a filename or a binary object.
def convert_odt_to_text(filename: str = None,
blob: bytes = None,
config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
"""
Converts an OpenOffice ODT file to text.
Pa... |
Converts HTML to text.
def convert_html_to_text(
filename: str = None,
blob: bytes = None,
config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
"""
Converts HTML to text.
"""
with get_filelikeobject(filename, blob) as fp:
soup = bs4.BeautifulSoup(fp)
return so... |
Converts XML to text.
def convert_xml_to_text(filename: str = None,
blob: bytes = None,
config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
"""
Converts XML to text.
"""
with get_filelikeobject(filename, blob) as fp:
soup = bs4.BeautifulStoneS... |
Converts RTF to text.
def convert_rtf_to_text(filename: str = None,
blob: bytes = None,
config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
"""
Converts RTF to text.
"""
unrtf = tools['unrtf']
if unrtf: # Best
args = [unrtf, '--text', '--... |
Is an RTF processor available?
def availability_rtf() -> bool:
"""
Is an RTF processor available?
"""
unrtf = tools['unrtf']
if unrtf:
return True
elif pyth:
log.warning("RTF conversion: unrtf missing; "
"using pyth (less efficient)")
return True
... |
Converts Microsoft Word DOC files to text.
def convert_doc_to_text(filename: str = None,
blob: bytes = None,
config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
"""
Converts Microsoft Word DOC files to text.
"""
antiword = tools['antiword']
if ant... |
Convert arbitrary files to text, using ``strings`` or ``strings2``.
(``strings`` is a standard Unix command to get text from any old rubbish.)
def convert_anything_to_text(
filename: str = None,
blob: bytes = None,
config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
"""
Convert ... |
Converts a document to text.
This function selects a processor based on the file extension (either from
the filename, or, in the case of a BLOB, the extension specified manually
via the ``extension`` parameter).
Pass either a filename or a binary object.
- Raises an exception for malformed argume... |
Is a text extractor available for the specified extension?
def is_text_extractor_available(extension: str) -> bool:
"""
Is a text extractor available for the specified extension?
"""
if extension is not None:
extension = extension.lower()
info = ext_map.get(extension)
if info is None:
... |
Command-line processor. See ``--help`` for details.
def main() -> None:
"""
Command-line processor. See ``--help`` for details.
"""
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser()
parser.add_argument("inputfile", nargs="?", help="Input file name")
parser.add_argu... |
Chooses basic or verbose logging.
def set_verbose_logging(verbose: bool) -> None:
"""Chooses basic or verbose logging."""
if verbose:
set_loglevel(logging.DEBUG)
else:
set_loglevel(logging.INFO) |
Writes SQL and arguments to the log.
def debug_sql(sql: str, *args: Any) -> None:
"""Writes SQL and arguments to the log."""
log.debug("SQL: %s" % sql)
if args:
log.debug("Args: %r" % args) |
Delimits x, using delims[0] (left) and delims[1] (right).
def delimit(x: str, delims: Tuple[str, str]) -> str:
"""Delimits x, using delims[0] (left) and delims[1] (right)."""
return delims[0] + x + delims[1] |
Returns SQL:
SELECT [all fields in the fieldlist] WHERE [keyname] = ?
def get_sql_select_all_fields_by_key(
table: str,
fieldlist: Sequence[str],
keyname: str,
delims: Tuple[str, str] = ("", "")) -> str:
"""Returns SQL:
SELECT [all fields in the fieldlist] WHERE [key... |
Returns ?-marked SQL for an INSERT statement.
def get_sql_insert(table: str,
fieldlist: Sequence[str],
delims: Tuple[str, str] = ("", "")) -> str:
"""Returns ?-marked SQL for an INSERT statement."""
return (
"INSERT INTO " + delimit(table, delims) +
" (" +
... |
Returns ?-marked SQL for an INSERT-or-if-duplicate-key-UPDATE statement.
def get_sql_insert_or_update(table: str,
fieldlist: Sequence[str],
delims: Tuple[str, str] = ("", "")) -> str:
"""Returns ?-marked SQL for an INSERT-or-if-duplicate-key-UPDATE statemen... |
Returns ?-marked SQL for an INSERT statement, ignoring the first field
(typically, the PK).
def get_sql_insert_without_first_field(
table: str,
fieldlist: Sequence[str],
delims: Tuple[str, str] = ("", "")) -> str:
"""Returns ?-marked SQL for an INSERT statement, ignoring the first field... |
Returns SQL for an UPDATE statement, to update all fields except the
first field (PK) using the PK as the key.
def get_sql_update_by_first_field(table: str,
fieldlist: Sequence[str],
delims: Tuple[str, str] = ("", "")) -> str:
"""Returns SQL f... |
Reverses sql_quote_string.
def sql_dequote_string(s: str) -> str:
"""Reverses sql_quote_string."""
if len(s) < 2:
# Something wrong.
return s
s = s[1:-1] # strip off the surrounding quotes
return s.replace("''", "'") |
Format a DateTime object as something MySQL will actually accept.
def datetime2literal_rnc(d: datetime.datetime, c: Optional[Dict]) -> str:
"""Format a DateTime object as something MySQL will actually accept."""
# dt = d.strftime("%Y-%m-%d %H:%M:%S")
# ... can fail with e.g.
# ValueError: year=1850 i... |
Converts a full datatype, e.g. INT, VARCHAR(10), VARCHAR(MAX), to a
MySQL equivalent.
def full_datatype_to_mysql(d: str) -> str:
"""Converts a full datatype, e.g. INT, VARCHAR(10), VARCHAR(MAX), to a
MySQL equivalent."""
d = d.upper()
(s, length) = split_long_sqltype(d)
if d in ["VARCHAR(MAX)",... |
Prints key/value pairs for an object's dictionary.
def debug_object(obj: T) -> str:
"""Prints key/value pairs for an object's dictionary."""
pairs = []
for k, v in vars(obj).items():
pairs.append(u"{}={}".format(k, v))
return u", ".join(pairs) |
Prints key/value pairs for an object's dictionary.
def dump_database_object(obj: T, fieldlist: Iterable[str]) -> None:
"""Prints key/value pairs for an object's dictionary."""
log.info(_LINE_EQUALS)
log.info("DUMP OF: {}", obj)
for f in fieldlist:
log.info(u"{f}: {v}", f=f, v=getattr(obj, f))
... |
Within "obj", assigns the values from the value list to the fields in
the fieldlist.
def assign_from_list(obj: T,
fieldlist: Sequence[str],
valuelist: Sequence[any]) -> None:
"""Within "obj", assigns the values from the value list to the fields in
the fieldlist."""... |
Create an object by instantiating ``cls(*args, **kwargs)`` and assigning the
values in ``valuelist`` to the fields in ``fieldlist``.
If ``construct_with_pk`` is ``True``, initialize with
``cls(valuelist[0], *args, **kwargs)``
and assign the values in ``valuelist[1:]`` to ``fieldlist[1:]``.
Note: i... |
Within "obj", sets all fields in the fieldlist to None.
def blank_object(obj: T, fieldlist: Sequence[str]) -> None:
"""Within "obj", sets all fields in the fieldlist to None."""
for f in fieldlist:
setattr(obj, f, None) |
Writes a query result to the log.
def debug_query_result(rows: Sequence[Any]) -> None:
"""Writes a query result to the log."""
log.info("Retrieved {} rows", len(rows))
for i in range(len(rows)):
log.info("Row {}: {}", i, rows[i]) |
Connects via PyMySQL/MySQLdb and creates a database.
def create_database_mysql(database: str,
user: str,
password: str,
server: str = "localhost",
port: int = 3306,
charset: str = "utf8",
... |
Connects via PyMySQL/MySQLdb and creates a database superuser.
def add_master_user_mysql(database: str,
root_user: str,
root_password: str,
new_user: str,
new_password: str,
server: str = "... |
Returns details on a specific table.
def describe_table(cls,
db: DATABASE_SUPPORTER_FWD_REF,
table: str) -> List[List[Any]]:
"""Returns details on a specific table."""
raise RuntimeError(_MSG_NO_FLAVOUR) |
Returns all column names for a table.
def fetch_column_names(cls,
db: DATABASE_SUPPORTER_FWD_REF,
table: str) -> List[str]:
"""Returns all column names for a table."""
raise RuntimeError(_MSG_NO_FLAVOUR) |
Returns database SQL datatype for a column: e.g. VARCHAR.
def get_datatype(cls,
db: DATABASE_SUPPORTER_FWD_REF,
table: str,
column: str) -> str:
"""Returns database SQL datatype for a column: e.g. VARCHAR."""
raise RuntimeError(_MSG_NO_FLAV... |
Do we have read-only access?
def is_read_only(cls,
db: DATABASE_SUPPORTER_FWD_REF,
logger: logging.Logger = None) -> bool:
"""Do we have read-only access?"""
def convert_enums(row_):
# All these columns are of type enum('N', 'Y');
# htt... |
engine: access, mysql, sqlserver
interface: mysql, odbc, jdbc
def connect(self,
engine: str = None,
interface: str = None,
host: str = None,
port: int = None,
database: str = None,
driver: str = None,
... |
Pings a database connection, reconnecting if necessary.
def ping(self) -> None:
"""Pings a database connection, reconnecting if necessary."""
if self.db is None or self.db_pythonlib not in [PYTHONLIB_MYSQLDB,
PYTHONLIB_PYMYSQL]:
return... |
Connects to a MySQL database via ODBC.
def connect_to_database_odbc_mysql(self,
database: str,
user: str,
password: str,
server: str = "localhost",
... |
Connects to an SQL Server database via ODBC.
def connect_to_database_odbc_sqlserver(self,
odbc_connection_string: str = None,
dsn: str = None,
database: str = None,
... |
Connects to an Access database via ODBC, with the DSN
prespecified.
def connect_to_database_odbc_access(self,
dsn: str,
autocommit: bool = True) -> None:
"""Connects to an Access database via ODBC, with the DSN
pres... |
Translates ?-placeholder SQL to appropriate dialect.
For example, MySQLdb uses %s rather than ?.
def localize_sql(self, sql: str) -> str:
"""Translates ?-placeholder SQL to appropriate dialect.
For example, MySQLdb uses %s rather than ?.
"""
# pyodbc seems happy with ? now (py... |
Inserts a record into database, table "table", using the list of
fieldnames and the list of values. Returns the new PK (or None).
def insert_record(self,
table: str,
fields: Sequence[str],
values: Sequence[Any],
update_on_d... |
Inserts a record into the database using a list of fieldspecs having
their value stored under the 'value' key.
def insert_record_by_fieldspecs_with_values(
self,
table: str,
fieldspeclist: FIELDSPECLIST_TYPE) -> int:
"""Inserts a record into the database using a list... |
Inserts a record into database, table "table", using a dictionary
containing field/value mappings. Returns the new PK (or None).
def insert_record_by_dict(self,
table: str,
valuedict: Dict[str, Any]) -> Optional[int]:
"""Inserts a record into ... |
Inserts a record into database, table "table", using the list of
fieldnames and the list of records (each a list of values).
Returns number of rows affected.
def insert_multiple_records(self,
table: str,
fields: Sequence[str],
... |
Executes SQL on a supplied cursor, with "?" placeholders,
substituting in the arguments. Returns number of rows affected.
def db_exec_with_cursor(self, cursor, sql: str, *args) -> int:
"""Executes SQL on a supplied cursor, with "?" placeholders,
substituting in the arguments. Returns number of ... |
Executes SQL (with "?" placeholders for arguments).
def db_exec(self, sql: str, *args) -> int:
"""Executes SQL (with "?" placeholders for arguments)."""
self.ensure_db_open()
cursor = self.db.cursor()
return self.db_exec_with_cursor(cursor, sql, *args) |
Execute SQL and commit.
def db_exec_and_commit(self, sql: str, *args) -> int:
"""Execute SQL and commit."""
rowcount = self.db_exec(sql, *args)
self.commit()
return rowcount |
Executes SQL without modification. Returns rowcount.
def db_exec_literal(self, sql: str) -> int:
"""Executes SQL without modification. Returns rowcount."""
self.ensure_db_open()
cursor = self.db.cursor()
debug_sql(sql)
try:
cursor.execute(sql)
return curs... |
Executes SQL; returns the first value of the first row, or None.
def fetchvalue(self, sql: str, *args) -> Optional[Any]:
"""Executes SQL; returns the first value of the first row, or None."""
row = self.fetchone(sql, *args)
if row is None:
return None
return row[0] |
Executes SQL; returns the first row, or None.
def fetchone(self, sql: str, *args) -> Optional[Sequence[Any]]:
"""Executes SQL; returns the first row, or None."""
self.ensure_db_open()
cursor = self.db.cursor()
self.db_exec_with_cursor(cursor, sql, *args)
try:
return ... |
Executes SQL; returns all rows, or [].
def fetchall(self, sql: str, *args) -> Sequence[Sequence[Any]]:
"""Executes SQL; returns all rows, or []."""
self.ensure_db_open()
cursor = self.db.cursor()
self.db_exec_with_cursor(cursor, sql, *args)
try:
rows = cursor.fetchal... |
fetchall() as a generator.
def gen_fetchall(self, sql: str, *args) -> Iterator[Sequence[Any]]:
"""fetchall() as a generator."""
self.ensure_db_open()
cursor = self.db.cursor()
self.db_exec_with_cursor(cursor, sql, *args)
try:
row = cursor.fetchone()
while... |
Executes SQL; returns (rows, fieldnames).
def fetchall_with_fieldnames(self, sql: str, *args) \
-> Tuple[Sequence[Sequence[Any]], Sequence[str]]:
"""Executes SQL; returns (rows, fieldnames)."""
self.ensure_db_open()
cursor = self.db.cursor()
self.db_exec_with_cursor(cursor, ... |
Executes SQL; returns list of dictionaries, where each dict contains
fieldname/value pairs.
def fetchall_as_dictlist(self, sql: str, *args) -> List[Dict[str, Any]]:
"""Executes SQL; returns list of dictionaries, where each dict contains
fieldname/value pairs."""
self.ensure_db_open()
... |
Executes SQL; returns list of first values of each row.
def fetchallfirstvalues(self, sql: str, *args) -> List[Any]:
"""Executes SQL; returns list of first values of each row."""
rows = self.fetchall(sql, *args)
return [row[0] for row in rows] |
Executes SQL; returns just the output fieldnames.
def fetch_fieldnames(self, sql: str, *args) -> List[str]:
"""Executes SQL; returns just the output fieldnames."""
self.ensure_db_open()
cursor = self.db.cursor()
self.db_exec_with_cursor(cursor, sql, *args)
try:
retur... |
Counts rows in a table, given a set of WHERE criteria (ANDed),
returning a count.
def count_where(self, table: str, wheredict: Dict[str, Any] = None) -> int:
"""Counts rows in a table, given a set of WHERE criteria (ANDed),
returning a count."""
sql = "SELECT COUNT(*) FROM " + self.deli... |
Checks for the existence of a record by a single field (typically a
PK).
def does_row_exist(self, table: str, field: str, value: Any) -> bool:
"""Checks for the existence of a record by a single field (typically a
PK)."""
sql = ("SELECT COUNT(*) FROM " + self.delimit(table) +
... |
Deletes all records where "field" is "value".
def delete_by_field(self, table: str, field: str, value: Any) -> int:
"""Deletes all records where "field" is "value"."""
sql = ("DELETE FROM " + self.delimit(table) +
" WHERE " + self.delimit(field) + "=?")
return self.db_exec(sql, v... |
Fetches object from database table by PK value. Writes back to
object. Returns True/False for success/failure.
def fetch_object_from_db_by_pk(self,
obj: Any,
table: str,
fieldlist: Sequence[str],
... |
Fetches object from database table by a field specified by
keyname/keyvalue. Writes back to object. Returns True/False for
success/failure.
def fetch_object_from_db_by_other_field(self,
obj: Any,
table: str,
... |
Fetches all objects from a table, returning an array of objects of
class cls.
def fetch_all_objects_from_db(self,
cls: Type[T],
table: str,
fieldlist: Sequence[str],
construct... |
Fetches all objects from a table, given a list of PKs.
def fetch_all_objects_from_db_by_pklist(self,
cls: Type,
table: str,
fieldlist: Sequence[str],
... |
Fetches all objects from a table, given a set of WHERE criteria
(ANDed), returning an array of objects of class cls.
As usual here, the first field in the fieldlist must be the PK.
def fetch_all_objects_from_db_where(self,
cls: Type[T],
... |
Inserts object into database table, with PK (first field) already
known.
def insert_object_into_db_pk_known(self,
obj: Any,
table: str,
fieldlist: Sequence[str]) -> None:
"""Inserts obje... |
Inserts object into database table, with PK (first field) initially
unknown (and subsequently set in the object from the database).
def insert_object_into_db_pk_unknown(self,
obj: Any,
table: str,
... |
Updates an object in the database (saves it to the database, where
it exists there already).
def update_object_in_db(self,
obj: Any,
table: str,
fieldlist: Sequence[str]) -> None:
"""Updates an object in the database (s... |
Saves a object to the database, inserting or updating as
necessary.
def save_object_to_db(self,
obj: Any,
table: str,
fieldlist: Sequence[str],
is_new_record: bool) -> None:
"""Saves a object to the ... |
Does an index exist? (Specific to MySQL.)
def index_exists(self, table: str, indexname: str) -> bool:
"""Does an index exist? (Specific to MySQL.)"""
# MySQL:
sql = ("SELECT COUNT(*) FROM information_schema.statistics"
" WHERE table_name=? AND index_name=?")
row = self.fe... |
Creates an index (default name _idx_FIELDNAME), unless it exists
already.
def create_index(self,
table: str,
field: str,
nchars: int = None,
indexname: str = None,
unique: bool = False) -> Optional[int]:
... |
Calls create_index based on a fieldspec, if the fieldspec has
indexed = True.
def create_index_from_fieldspec(self,
table: str,
fieldspec: FIELDSPEC_TYPE,
indexname: str = None) -> None:
"""Calls... |
Creates a FULLTEXT index (default name _idxft_FIELDNAME), unless it
exists already. See:
http://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html
http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
def create_fulltext_index(self,
table: str,
... |
Returns SQL fragment to define a field.
def fielddefsql_from_fieldspec(fieldspec: FIELDSPEC_TYPE) -> str:
"""Returns SQL fragment to define a field."""
sql = fieldspec["name"] + " " + fieldspec["sqltype"]
if "notnull" in fieldspec and fieldspec["notnull"]:
sql += " NOT NULL"
... |
Returns list of field-defining SQL fragments.
def fielddefsql_from_fieldspeclist(
self, fieldspeclist: FIELDSPECLIST_TYPE) -> str:
"""Returns list of field-defining SQL fragments."""
return ",".join([
self.fielddefsql_from_fieldspec(x)
for x in fieldspeclist
... |
Returns a subset of the fieldspecs matching the fieldnames list.
def fieldspec_subset_by_name(
fieldspeclist: FIELDSPECLIST_TYPE,
fieldnames: Container[str]) -> FIELDSPECLIST_TYPE:
"""Returns a subset of the fieldspecs matching the fieldnames list."""
result = []
for x i... |
Does the table exist?
def table_exists(self, tablename: str) -> bool:
"""Does the table exist?"""
# information_schema is ANSI standard
sql = """
SELECT COUNT(*)
FROM information_schema.tables
WHERE table_name=?
AND table_schema={}
""".for... |
Does the column exist?
def column_exists(self, tablename: str, column: str) -> bool:
"""Does the column exist?"""
sql = """
SELECT COUNT(*)
FROM information_schema.columns
WHERE table_name=?
AND column_name=?
AND table_schema={}
""".fo... |
Drops a table. Use caution!
def drop_table(self, tablename: str) -> int:
"""Drops a table. Use caution!"""
sql = "DROP TABLE IF EXISTS {}".format(tablename)
log.info("Dropping table " + tablename + " (ignore any warning here)")
return self.db_exec_literal(sql) |
Drops a view.
def drop_view(self, viewname: str) -> int:
"""Drops a view."""
sql = "DROP VIEW IF EXISTS {}".format(viewname)
log.info("Dropping view " + viewname + " (ignore any warning here)")
return self.db_exec_literal(sql) |
Makes a table, if it doesn't already exist.
def make_table(self,
tablename: str,
fieldspeclist: FIELDSPECLIST_TYPE,
dynamic: bool = False,
compressed: bool = False) -> Optional[int]:
"""Makes a table, if it doesn't already exist."""
... |
Renames a table. MySQL-specific.
def rename_table(self, from_table: str, to_table: str) -> Optional[int]:
"""Renames a table. MySQL-specific."""
if not self.table_exists(from_table):
log.info("Skipping renaming of table " + from_table +
" (doesn't exist)")
r... |
Adds a column to an existing table.
def add_column(self, tablename: str, fieldspec: FIELDSPEC_TYPE) -> int:
"""Adds a column to an existing table."""
sql = "ALTER TABLE {} ADD COLUMN {}".format(
tablename, self.fielddefsql_from_fieldspec(fieldspec))
log.info(sql)
return self... |
Drops (deletes) a column from an existing table.
def drop_column(self, tablename: str, fieldname: str) -> int:
"""Drops (deletes) a column from an existing table."""
sql = "ALTER TABLE {} DROP COLUMN {}".format(tablename, fieldname)
log.info(sql)
return self.db_exec_literal(sql) |
Alters a column's definition without renaming it.
def modify_column_if_table_exists(self,
tablename: str,
fieldname: str,
newdef: str) -> Optional[int]:
"""Alters a column's definition without rena... |
Renames a column and alters its definition.
def change_column_if_table_exists(self,
tablename: str,
oldfieldname: str,
newfieldname: str,
newdef: str) -> Optional[int]... |
- Make table, if it doesn't exist.
- Add fields that aren't there.
- Warn about superfluous fields, but don't delete them, unless
``drop_superfluous_columns == True``.
- Make indexes, if requested.
def create_or_update_table(self,
tablename: str,
... |
Returns details on a specific table.
def describe_table(self, table: str) -> List[List[Any]]:
"""Returns details on a specific table."""
return self.flavour.describe_table(self, table) |
Returns all column names for a table.
def fetch_column_names(self, table: str) -> List[str]:
"""Returns all column names for a table."""
return self.flavour.fetch_column_names(self, table) |
Returns database SQL datatype for a column: e.g. VARCHAR.
def get_datatype(self, table: str, column: str) -> str:
"""Returns database SQL datatype for a column: e.g. VARCHAR."""
return self.flavour.get_datatype(self, table, column).upper() |
Returns database SQL datatype for a column, e.g. VARCHAR(50).
def get_column_type(self, table: str, column: str) -> str:
"""Returns database SQL datatype for a column, e.g. VARCHAR(50)."""
return self.flavour.get_column_type(self, table, column).upper() |
Returns database SQL comment for a column.
def get_comment(self, table: str, column: str) -> str:
"""Returns database SQL comment for a column."""
return self.flavour.get_comment(self, table, column) |
Executes SQL and writes the result to the log.
def debug_query(self, sql: str, *args) -> None:
"""Executes SQL and writes the result to the log."""
rows = self.fetchall(sql, *args)
debug_query_result(rows) |
Delete all records from a table. Use caution!
def wipe_table(self, table: str) -> int:
"""Delete all records from a table. Use caution!"""
sql = "DELETE FROM " + self.delimit(table)
return self.db_exec(sql) |
Make a primary key, or replace it if it exists.
def create_or_replace_primary_key(self,
table: str,
fieldnames: Sequence[str]) -> int:
"""Make a primary key, or replace it if it exists."""
# *** create_or_replace_primary_key: U... |
Covariance taking into account the 'noise covariance' of the data.
This is technically more realistic for continuously sampled data.
From Faber, 1993
def noise_covariance(fit, dof=2, **kw):
"""
Covariance taking into account the 'noise covariance' of the data.
This is technically more realistic for... |
Minimum and maximum angular errors
corresponding to 1st and 2nd axes
of PCA distribution.
Ordered as [minimum, maximum] angular error.
def angular_errors(hyp_axes):
"""
Minimum and maximum angular errors
corresponding to 1st and 2nd axes
of PCA distribution.
Ordered as [minimum, maxim... |
Hyperbolic error using a statistical process (either sampling
or noise errors)
Integrates covariance with error level
and degrees of freedom for plotting
confidence intervals.
Degrees of freedom is set to 2, which is the
relevant number of independent dimensions
to planar fitting of *a pri... |
Implements ``CREATE VIEW``.
Args:
operations: instance of ``alembic.operations.base.Operations``
operation: instance of :class:`.ReversibleOp`
Returns:
``None``
def create_view(operations, operation):
"""
Implements ``CREATE VIEW``.
Args:
operations: instance of `... |
Implements ``CREATE FUNCTION``.
Args:
operations: instance of ``alembic.operations.base.Operations``
operation: instance of :class:`.ReversibleOp`
Returns:
``None``
def create_sp(operations, operation):
"""
Implements ``CREATE FUNCTION``.
Args:
operations: instanc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.