[orm] added a check for joining from A->B using join(), along two different m2m tables. this raises an error in 0.3 but is possible in 0.4 when aliases are used.(link)
[orm] fixed small exception throw bug in Session.merge()(link)
[orm] fixed bug where mapper, being linked to a join where one table had no PK columns, would not detect that the joined table had no PK.(link)
[orm] fixed bugs in determining proper sync clauses from custom inherit conditions(link)
[orm] backref remove object operation doesn’t fail if the other-side collection doesn’t contain the item, supports noload collections(link)
[engine] fixed another occasional race condition which could occur when using pool with threadlocal setting(link)
[sql] tweak DISTINCT precedence for clauses like func.count(t.c.col.distinct())(link)
[sql] Fixed detection of internal ‘$’ characters in :bind$params(link)
[sql] dont assume join criterion consists only of column objects(link)
[sql] adjusted operator precedence of NOT to match ‘==’ and others, so that ~(x==y) produces NOT (x=y), which is compatible with MySQL < 5.0 (doesn’t like “NOT x=y”)(link)
[mssql] added support for TIME columns (simulated using DATETIME)(link)
[mssql] added support for BIGINT, MONEY, SMALLMONEY, UNIQUEIDENTIFIER and SQL_VARIANT(link)
[mssql] index names are now quoted when dropping from reflected tables(link)
[mssql] can now specify a DSN for PyODBC, using a URI like mssql:///?dsn=bob(link)
[postgres] when reflecting tables from alternate schemas, the “default” placed upon the primary key, i.e. usually a sequence name, has the “schema” name unconditionally quoted, so that schema names which need quoting are fine. its slightly unnecessary for schema names which don’t need quoting but not harmful.(link)
[general] a new mutex that was added in 0.3.9 causes the pool_timeout feature to fail during a race condition; threads would raise TimeoutError immediately with no delay if many threads push the pool into overflow at the same time. this issue has been fixed.(link)
[general] better error message for NoSuchColumnError(link)
[general] finally figured out how to get setuptools version in, available as sqlalchemy.__version__(link)
[general] the various “engine” arguments, such as “engine”, “connectable”, “engine_or_url”, “bind_to”, etc. are all present, but deprecated. they all get replaced by the single term “bind”. you also set the “bind” of MetaData using metadata.bind = <engine or connection>(link)
[orm] forwards-compatibility with 0.4: added one(), first(), and all() to Query. almost all Query functionality from 0.4 is present in 0.3.9 for forwards-compat purposes.(link)
[orm] reset_joinpoint() really really works this time, promise ! lets you re-join from the root: query.join([‘a’, ‘b’]).filter(<crit>).reset_joinpoint().join([‘a’, ‘c’]).filter(<some other crit>).all() in 0.4 all join() calls start from the “root”(link)
[orm] added synchronization to the mapper() construction step, to avoid thread collisions when pre-existing mappers are compiling in a different thread(link)
[orm] a warning is issued by Mapper when two primary key columns of the same name are munged into a single attribute. this happens frequently when mapping to joins (or inheritance).(link)
[orm] synonym() properties are fully supported by all Query joining/ with_parent operations(link)
[orm] fixed very stupid bug when deleting items with many-to-many uselist=False relations(link)
[orm] remember all that stuff about polymorphic_union ? for joined table inheritance ? Funny thing... You sort of don’t need it for joined table inheritance, you can just string all the tables together via outerjoin(). The UNION still applies if concrete tables are involved, though (since nothing to join them on).(link)
[orm] small fix to eager loading to better work with eager loads to polymorphic mappers that are using a straight “outerjoin” clause(link)
[sql] ForeignKey to a table in a schema thats not the default schema requires the schema to be explicit; i.e. ForeignKey(‘alt_schema.users.id’)(link)
[sql] MetaData can now be constructed with an engine or url as the first argument, just like BoundMetaData(link)
[sql] BoundMetaData is now deprecated, and MetaData is a direct substitute.(link)
[sql] DynamicMetaData has been renamed to ThreadLocalMetaData. the DynamicMetaData name is deprecated and is an alias for ThreadLocalMetaData or a regular MetaData if threadlocal=False(link)
[sql] composite primary key is represented as a non-keyed set to allow for composite keys consisting of cols with the same name; occurs within a Join. helps inheritance scenarios formulate correct PK.(link)
[sql] improved ability to get the “correct” and most minimal set of primary key columns from a join, equating foreign keys and otherwise equated columns. this is also mostly to help inheritance scenarios formulate the best choice of primary key columns.(link)
[sql] added ‘bind’ argument to Sequence.create()/drop(), ColumnDefault.execute()(link)
[sql] columns can be overridden in a reflected table with a “key” attribute different than the column’s name, including for primary key columns(link)
[sql] fixed “ambiguous column” result detection, when dupe col names exist in a result(link)
[sql] some enhancements to “column targeting”, the ability to match a column to a “corresponding” column in another selectable. this affects mostly ORM ability to map to complex joins(link)
[sql] MetaData and all SchemaItems are safe to use with pickle. slow table reflections can be dumped into a pickled file to be reused later. Just reconnect the engine to the metadata after unpickling.(link)
[sql] added a mutex to QueuePool’s “overflow” calculation to prevent a race condition that can bypass max_overflow(link)
[sql] fixed grouping of compound selects to give correct results. will break on sqlite in some cases, but those cases were producing incorrect results anyway, sqlite doesn’t support grouped compound selects(link)
[sql] fixed precedence of operators so that parenthesis are correctly applied(link)
[sql] calling <column>.in_() (i.e. with no arguments) will return “CASE WHEN (<column> IS NULL) THEN NULL ELSE 0 END = 1)”, so that NULL or False is returned in all cases, rather than throwing an error(link)
[sql] fixed “where”/”from” criterion of select() to accept a unicode string in addition to regular string - both convert to text()(link)
[sql] added standalone distinct() function in addition to column.distinct()(link)
[sql] result.last_inserted_ids() should return a list that is identically sized to the primary key constraint of the table. values that were “passively” created and not available via cursor.lastrowid will be None.(link)
[sql] long-identifier detection fixed to use > rather than >= for max ident length(link)
[sql] fixed bug where selectable.corresponding_column(selectable.c.col) would not return selectable.c.col, if the selectable is a join of a table and another join involving the same table. messed up ORM decision making(link)
[sql] added Interval type to types.py(link)
[oracle] datetime fixes: got subsecond TIMESTAMP to work, added OracleDate which supports types.Date with only year/month/day(link)
[oracle] added dialect flag “auto_convert_lobs”, defaults to True; will cause any LOB objects detected in a result set to be forced into OracleBinary so that the LOB is read() automatically, if no typemap was present (i.e., if a textual execute() was issued).(link)
[oracle] mod operator ‘%’ produces MOD(link)
[oracle] converts cx_oracle datetime objects to Python datetime.datetime when Python 2.3 used(link)
[oracle] fixed unicode conversion in Oracle TEXT type(link)
[ext] iteration over dict association proxies is now dict-like, not InstrumentedList-like (e.g. over keys instead of values)(link)
[ext] association proxies no longer bind tightly to source collections, and are constructed with a thunk instead(link)
[ext] added selectone_by() to assignmapper(link)
[postgres] fixed escaping of the modulo operator(link)
[postgres] added support for reflection of domains(link)
[postgres] types which are missing during reflection resolve to Null type instead of raising an error(link)
[postgres] the fix in “schema” above fixes reflection of foreign keys from an alt-schema table to a public schema table(link)
[orm] added reset_joinpoint() method to Query, moves the “join point” back to the starting mapper. 0.4 will change the behavior of join() to reset the “join point” in all cases so this is an interim method. for forwards compatibility, ensure joins across multiple relations are specified using a single join(), i.e. join([‘a’, ‘b’, ‘c’]).(link)
[orm] fixed bug in query.instances() that wouldnt handle more than on additional mapper or one additional column.(link)
[orm] “delete-orphan” no longer implies “delete”. ongoing effort to separate the behavior of these two operations.(link)
[orm] many-to-many relationships properly set the type of bind params for delete operations on the association table(link)
[orm] many-to-many relationships check that the number of rows deleted from the association table by a delete operation matches the expected results(link)
[orm] session.get() and session.load() propagate **kwargs through to query(link)
[orm] fix to polymorphic query which allows the original polymorphic_union to be embedded into a correlated subquery(link)
[orm] fix to select_by(<propname>=<object instance>) -style joins in conjunction with many-to-many relationships, bug introduced in r2556(link)
[orm] the “primary_key” argument to mapper() is propagated to the “polymorphic” mapper. primary key columns in this list get normalized to that of the mapper’s local table.(link)
[orm] restored logging of “lazy loading clause” under sa.orm.strategies logger, got removed in 0.3.7(link)
[orm] improved support for eagerloading of properties off of mappers that are mapped to select() statements; i.e. eagerloader is better at locating the correct selectable with which to attach its LEFT OUTER JOIN.(link)
[sql] _Label class overrides compare_self to return its ultimate object. meaning, if you say someexpr.label(‘foo’) == 5, it produces the correct “someexpr == 5”.(link)
[sql] _Label propagates “_hide_froms()” so that scalar selects behave more properly with regards to FROM clause #574(link)
[sql] fix to long name generation when using oid_column as an order by (oids used heavily in mapper queries)(link)
[sql] significant speed improvement to ResultProxy, pre-caches TypeEngine dialect implementations and saves on function calls per column(link)
[sql] parenthesis are applied to clauses via a new _Grouping construct. uses operator precedence to more intelligently apply parenthesis to clauses, provides cleaner nesting of clauses (doesnt mutate clauses placed in other clauses, i.e. no ‘parens’ flag)(link)
[sql] added ‘modifier’ keyword, works like func.<foo> except does not add parenthesis. e.g. select([modifier.DISTINCT(...)]) etc.(link)
[sql] removed “no group by’s in a select thats part of a UNION” restriction(link)
[mysql] Nearly all MySQL column types are now supported for declaration and reflection. Added NCHAR, NVARCHAR, VARBINARY, TINYBLOB, LONGBLOB, YEAR(link)
[mysql] The sqltypes.Binary passthrough now always builds a BLOB, avoiding problems with very old database versions(link)
[mysql] support for column-level CHARACTER SET and COLLATE declarations, as well as ASCII, UNICODE, NATIONAL and BINARY shorthand.(link)
[firebird] set max identifier length to 31(link)
[firebird] supports_sane_rowcount() set to False due to ticket #370. versioned_id_col feature wont work in FB.(link)
[firebird] some execution fixes(link)
[firebird] new association proxy implementation, implementing complete proxies to list, dict and set-based relation collections(link)
[firebird] added orderinglist, a custom list class that synchronizes an object attribute with that object’s position in the list(link)
[firebird] small fix to SelectResultsExt to not bypass itself during select().(link)
[firebird] added filter(), filter_by() to assignmapper(link)
[engines] added detach() to Connection, allows underlying DBAPI connection to be detached from its pool, closing on dereference/close() instead of being reused by the pool.(link)
[engines] added invalidate() to Connection, immediately invalidates the Connection and its underlying DBAPI connection.(link)
[orm] fixed critical issue when, after options(eagerload()) is used, the mapper would then always apply query “wrapping” behavior for all subsequent LIMIT/OFFSET/DISTINCT queries, even if no eager loading was applied on those subsequent queries.(link)
[orm] added query.with_parent(someinstance) method. searches for target instance using lazy join criterion from parent instance. takes optional string “property” to isolate the desired relation. also adds static Query.query_from_parent(instance, property) version.(link)
[orm] improved query.XXX_by(someprop=someinstance) querying to use similar methodology to with_parent, i.e. using the “lazy” clause which prevents adding the remote instance’s table to the SQL, thereby making more complex conditions possible(link)
[orm] added generative versions of aggregates, i.e. sum(), avg(), etc. to query. used via query.apply_max(), apply_sum(), etc. #552(link)
[orm] fix to using distinct() or distinct=True in combination with join() and similar(link)
[orm] corresponding to label/bindparam name generation, eager loaders generate deterministic names for the aliases they create using md5 hashes.(link)
[orm] improved/fixed custom collection classes when giving it “set”/ “sets.Set” classes or subclasses (was still looking for append() methods on them during lazy loads)(link)
[orm] restored old “column_property()” ORM function (used to be called “column()”) to force any column expression to be added as a property on a mapper, particularly those that aren’t present in the mapped selectable. this allows “scalar expressions” of any kind to be added as relations (though they have issues with eager loads).(link)
[orm] fix to many-to-many relationships targeting polymorphic mappers(link)
[orm] making progress with session.merge() as well as combining its usage with entity_name(link)
[orm] the usual adjustments to relationships between inheriting mappers, in this case establishing relation()s to subclass mappers where the join conditions come from the superclass’ table(link)
[sql] keys() of result set columns are not lowercased, come back exactly as they’re expressed in cursor.description. note this causes colnames to be all caps in oracle.(link)
[sql] preliminary support for unicode table names, column names and SQL statements added, for databases which can support them. Works with sqlite and postgres so far. Mysql mostly works except the has_table() function does not work. Reflection works too.(link)
[sql] the Unicode type is now a direct subclass of String, which now contains all the “convert_unicode” logic. This helps the variety of unicode situations that occur in db’s such as MS-SQL to be better handled and allows subclassing of the Unicode datatype.(link)
[sql] ClauseElements can be used in in_() clauses now, such as bind parameters, etc. #476(link)
[sql] reverse operators implemented for CompareMixin elements, allows expressions like “5 + somecolumn” etc. #474(link)
[sql] the “where” criterion of an update() and delete() now correlates embedded select() statements against the table being updated or deleted. this works the same as nested select() statement correlation, and can be disabled via the correlate=False flag on the embedded select().(link)
[sql] column labels are now generated in the compilation phase, which means their lengths are dialect-dependent. So on oracle a label that gets truncated to 30 chars will go out to 63 characters on postgres. Also, the true labelname is always attached as the accessor on the parent Selectable so theres no need to be aware of the “truncated” label names.(link)
[sql] column label and bind param “truncation” also generate deterministic names now, based on their ordering within the full statement being compiled. this means the same statement will produce the same string across application restarts and allowing DB query plan caching to work better.(link)
[sql] the “mini” column labels generated when using subqueries, which are to work around glitchy SQLite behavior that doesnt understand “foo.id” as equivalent to “id”, are now only generated in the case that those named columns are selected from (part of)(link)
[sql] the label() method on ColumnElement will properly propagate the TypeEngine of the base element out to the label, including a label() created from a scalar=True select() statement.(link)
[sql] MS-SQL better detects when a query is a subquery and knows not to generate ORDER BY phrases for those(link)
[sql] fix for fetchmany() “size” argument being positional in most dbapis(link)
[sql] sending None as an argument to func.<something> will produce an argument of NULL(link)
[sql] query strings in unicode URLs get keys encoded to ascii for **kwargs compat(link)
[sql] slight tweak to raw execute() change to also support tuples for positional parameters, not just lists(link)
[sql] fix to case() construct to propagate the type of the first WHEN condition as the return type of the case statement(link)
[mysql] support for SSL arguments given as inline within URL query string, prefixed with “ssl_”, courtesy terjeros@gmail.com.(link)
[mysql] [<schemaname>] mysql uses “DESCRIBE.<tablename>”, catching exceptions if table doesnt exist, in order to determine if a table exists. this supports unicode table names as well as schema names. tested with MySQL5 but should work with 4.1 series as well. (#557)(link)
[sqlite] removed silly behavior where sqlite would reflect UNIQUE indexes as part of the primary key (?!)(link)
[mssql] pyodbc is now the preferred DB-API for MSSQL, and if no module is specifically requested, will be loaded first on a module probe.(link)
[mssql] The @@SCOPE_IDENTITY is now used instead of @@IDENTITY. This behavior may be overridden with the engine_connect “use_scope_identity” keyword parameter, which may also be specified in the dburi.(link)
[oracle] small fix to allow successive compiles of the same SELECT object which features LIMIT/OFFSET. oracle dialect needs to modify the object to have ROW_NUMBER OVER and wasn’t performing the full series of steps on successive compiles.(link)
[engines] warnings module used for issuing warnings (instead of logging)(link)
[engines] cleanup of DBAPI import strategies across all engines(link)
[engines] refactoring of engine internals which reduces complexity, number of codepaths; places more state inside of ExecutionContext to allow more dialect control of cursor handling, result sets. ResultProxy totally refactored and also has two versions of “buffered” result sets used for different purposes.(link)
[engines] server side cursor support fully functional in postgres.(link)
[engines] improved framework for auto-invalidation of connections that have lost their underlying database, via dialect-specific detection of exceptions corresponding to that database’s disconnect related error messages. Additionally, when a “connection no longer open” condition is detected, the entire connection pool is discarded and replaced with a new instance. #516(link)
[engines] the dialects within sqlalchemy.databases become a setuptools entry points. loading the built-in database dialects works the same as always, but if none found will fall back to trying pkg_resources to load an external module(link)
[engines] Engine contains a “url” attribute referencing the url.URL object used by create_engine().(link)
[informix] informix support added ! courtesy James Zhang, who put a ton of effort in.(link)
[extensions] big fix to AssociationProxy so that multiple AssociationProxy objects can be associated with a single association collection.(link)
[extensions] assign_mapper names methods according to their keys (i.e. __name__) #551(link)
[orm] the full featureset of the SelectResults extension has been merged into a new set of methods available off of Query. These methods all provide “generative” behavior, whereby the Query is copied and a new one returned with additional criterion added. The new methods include:
filter() - applies select criterion to the query filter_by() - applies “by”-style criterion to the query avg() - return the avg() function on the given column join() - join to a property (or across a list of properties) outerjoin() - like join() but uses LEFT OUTER JOIN limit()/offset() - apply LIMIT/OFFSET range-based access which applies limit/offset:session.query(Foo)[3:5]distinct() - apply DISTINCT list() - evaluate the criterion and return results
no incompatible changes have been made to Query’s API and no methods have been deprecated. Existing methods like select(), select_by(), get(), get_by() all execute the query at once and return results like they always did. join_to()/join_via() are still there although the generative join()/outerjoin() methods are easier to use.
(link)[orm] the return value for multiple mappers used with instances() now returns a cartesian product of the requested list of mappers, represented as a list of tuples. this corresponds to the documented behavior. So that instances match up properly, the “uniquing” is disabled when this feature is used.(link)
[orm] Query has add_entity() and add_column() generative methods. these will add the given mapper/class or ColumnElement to the query at compile time, and apply them to the instances() method. the user is responsible for constructing reasonable join conditions (otherwise you can get full cartesian products). result set is the list of tuples, non-uniqued.(link)
[orm] strings and columns can also be sent to the *args of instances() where those exact result columns will be part of the result tuples.(link)
[orm] a full select() construct can be passed to query.select() (which worked anyway), but also query.selectfirst(), query.selectone() which will be used as is (i.e. no query is compiled). works similarly to sending the results to instances().(link)
[orm] eager loading will not “aliasize” “order by” clauses that were placed in the select statement by something other than the eager loader itself, to fix possibility of dupe columns as illustrated in. however, this means you have to be more careful with the columns placed in the “order by” of Query.select(), that you have explicitly named them in your criterion (i.e. you cant rely on the eager loader adding them in for you)(link)
[orm] added a handy multi-use “identity_key()” method to Session, allowing the generation of identity keys for primary key values, instances, and rows, courtesy Daniel Miller(link)
[orm] many-to-many table will be properly handled even for operations that occur on the “backref” side of the operation(link)
[orm] added “refresh-expire” cascade. allows refresh() and expire() calls to propagate along relationships.(link)
[orm] more fixes to polymorphic relations, involving proper lazy-clause generation on many-to-one relationships to polymorphic mappers. also fixes to detection of “direction”, more specific targeting of columns that belong to the polymorphic union vs. those that dont.(link)
[orm] some fixes to relationship calcs when using “viewonly=True” to pull in other tables into the join condition which arent parent of the relationship’s parent/child mappings(link)
[orm] flush fixes on cyclical-referential relationships that contain references to other instances outside of the cyclical chain, when some of the objects in the cycle are not actually part of the flush(link)
[orm] put an aggressive check for “flushing object A with a collection of B’s, but you put a C in the collection” error condition - even if C is a subclass of B, unless B’s mapper loads polymorphically. Otherwise, the collection will later load a “B” which should be a “C” (since its not polymorphic) which breaks in bi-directional relationships (i.e. C has its A, but A’s backref will lazyload it as a different instance of type “B”) This check is going to bite some of you who do this without issues, so the error message will also document a flag “enable_typechecks=False” to disable this checking. But be aware that bi-directional relationships in particular become fragile without this check.(link)
[sql] bindparam() names are now repeatable! specify two distinct bindparam()s with the same name in a single statement, and the key will be shared. proper positional/named args translate at compile time. for the old behavior of “aliasing” bind parameters with conflicting names, specify “unique=True” - this option is still used internally for all the auto-genererated (value-based) bind parameters.(link)
[sql] slightly better support for bind params as column clauses, either via bindparam() or via literal(), i.e. select([literal(‘foo’)])(link)
[sql] MetaData can bind to an engine either via “url” or “engine” kwargs to constructor, or by using connect() method. BoundMetaData is identical to MetaData except engine_or_url param is required. DynamicMetaData is the same and provides thread-local connections be default.(link)
[sql] exists() becomes useable as a standalone selectable, not just in a WHERE clause, i.e. exists([columns], criterion).select()(link)
[sql] correlated subqueries work inside of ORDER BY, GROUP BY(link)
[sql] fixed function execution with explicit connections, i.e. conn.execute(func.dosomething())(link)
[sql] use_labels flag on select() wont auto-create labels for literal text column elements, since we can make no assumptions about the text. to create labels for literal columns, you can say “somecol AS somelabel”, or use literal_column(“somecol”).label(“somelabel”)(link)
[sql] quoting wont occur for literal columns when they are “proxied” into the column collection for their selectable (is_literal flag is propagated). literal columns are specified via literal_column(“somestring”).(link)
[sql] added “fold_equivalents” boolean argument to Join.select(), which removes ‘duplicate’ columns from the resulting column clause that are known to be equivalent based on the join condition. this is of great usage when constructing subqueries of joins which Postgres complains about if duplicate column names are present.(link)
[sql] fixed use_alter flag on ForeignKeyConstraint(link)
[sql] fixed usage of 2.4-only “reversed” in topological.py(link)
[sql] for hackers, refactored the “visitor” system of ClauseElement and SchemaItem so that the traversal of items is controlled by the ClauseVisitor itself, using the method visitor.traverse(item). accept_visitor() methods can still be called directly but will not do any traversal of child items. ClauseElement/SchemaItem now have a configurable get_children() method to return the collection of child elements for each parent object. This allows the full traversal of items to be clear and unambiguous (as well as loggable), with an easy method of limiting a traversal (just pass flags which are picked up by appropriate get_children() methods).(link)
[sql] the “else_” parameter to the case statement now properly works when set to zero.(link)
[oracle] got binary working for any size input ! cx_oracle works fine, it was my fault as BINARY was being passed and not BLOB for setinputsizes (also unit tests werent even setting input sizes).(link)
[oracle] also fixed CLOB read/write on a separate changeset.(link)
[oracle] auto_setinputsizes defaults to True for Oracle, fixed cases where it improperly propagated bad types.(link)
[extensions] options() method on SelectResults now implemented “generatively” like the rest of the SelectResults methods. But you’re going to just use Query now anyway.(link)
[extensions] query() method is added by assignmapper. this helps with navigating to all the new generative methods on Query.(link)
[ms-sql]
[ms-sql] null values in float fields no longer raise errors(link)
[ms-sql] LIMIT with OFFSET now raises an error (MS-SQL has no OFFSET support)(link)
[ms-sql] added an facility to use the MSSQL type VARCHAR(max) instead of TEXT for large unsized string fields. Use the new “text_as_varchar” to turn it on.(link)
[ms-sql] ORDER BY clauses without a LIMIT are now stripped in subqueries, as MS-SQL forbids this usage(link)
[ms-sql] cleanup of module importing code; specifiable DB-API module; more explicit ordering of module preferences.(link)
[orm] [bugs] another refactoring to relationship calculation. Allows more accurate ORM behavior with relationships from/to/between mappers, particularly polymorphic mappers, also their usage with Query, SelectResults. tickets include,,.(link)
[orm] [bugs] removed deprecated method of specifying custom collections on classes; you must now use the “collection_class” option. the old way was beginning to produce conflicts when people used assign_mapper(), which now patches an “options” method, in conjunction with a relationship named “options”. (relationships take precedence over monkeypatched assign_mapper methods).(link)
[orm] [bugs] extension() query option propagates to Mapper._instance() method so that all loading-related methods get called(link)
[orm] [bugs] eager relation to an inheriting mapper wont fail if no rows returned for the relationship.(link)
[orm] [bugs] eager relation loading bug fixed for eager relation on multiple descendant classes(link)
[orm] [bugs] fix for very large topological sorts, courtesy ants.aasma at gmail(link)
[orm] [bugs] eager loading is slightly more strict about detecting “self-referential” relationships, specifically between polymorphic mappers. this results in an “eager degrade” to lazy loading.(link)
[orm] [bugs] improved support for complex queries embedded into “where” criterion for query.select()(link)
[orm] [bugs] mapper options like eagerload(), lazyload(), deferred(), will work for “synonym()” relationships(link)
[orm] [bugs] fixed bug where cascade operations incorrectly included deleted collection items in the cascade(link)
[orm] [bugs] fixed relationship deletion error when one-to-many child item is moved to a new parent in a single unit of work(link)
[orm] [bugs] fixed relationship deletion error where parent/child with a single column as PK/FK on the child would raise a “blank out the primary key” error, if manually deleted or “delete” cascade without “delete-orphan” was used(link)
[orm] [bugs] fix to deferred so that load operation doesnt mistakenly occur when only PK col attributes are set(link)
[orm] [enhancements] implemented foreign_keys argument to mapper. use in conjunction with primaryjoin/secondaryjoin arguments to specify/override foreign keys defined on the Table instance.(link)
[orm] [enhancements] contains_eager(‘foo’) automatically implies eagerload(‘foo’)(link)
[orm] [enhancements] added “alias” argument to contains_eager(). use it to specify the string name or Alias instance of an alias used in the query for the eagerly loaded child items. easier to use than “decorator”(link)
[orm] [enhancements] added “contains_alias()” option for result set mapping to an alias of the mapped table(link)
[orm] [enhancements] added support for py2.5 “with” statement with SessionTransaction(link)
[sql] the value of “case_sensitive” defaults to True now, regardless of the casing of the identifier, unless specifically set to False. this is because the object might be label’ed as something else which does contain mixed case, and propigating “case_sensitive=False” breaks that. Other fixes to quoting when using labels and “fake” column objects(link)
[sql] added a “supports_execution()” method to ClauseElement, so that individual kinds of clauses can express if they are appropriate for executing...such as, you can execute a “select”, but not a “Table” or a “Join”.(link)
[sql] fixed argument passing to straight textual execute() on engine, connection. can handle *args or a list instance for positional, **kwargs or a dict instance for named args, or a list of list or dicts to invoke executemany()(link)
[sql] small fix to BoundMetaData to accept unicode or string URLs(link)
[sql] fixed named PrimaryKeyConstraint generation courtesy andrija at gmail(link)
[sql] fixed generation of CHECK constraints on columns(link)
[sql] fixes to tometadata() operation to propagate Constraints at column and table level(link)
[mysql] fix to reflection on older DB’s that might return array() type for “show variables like” statements(link)
[mssql] preliminary support for pyodbc (Yay!)(link)
[mssql] better support for NVARCHAR types added(link)
[mssql] fix for commit logic on pymssql(link)
[mssql] fix for query.get() with schema(link)
[mssql] fix for non-integer relationships(link)
[mssql] DB-API module now selectable at run-time(link)
[mssql] [415] [tickets:422] [481] now passes many more unit tests(link)
[mssql] better unittest compatibility with ANSI functions(link)
[mssql] improved support for implicit sequence PK columns with auto-insert(link)
[mssql] fix for blank password in adodbapi(link)
[mssql] fixes to get unit tests working with pyodbc(link)
[mssql] fix to auto_identity_insert on db-url query(link)
[mssql] added query_timeout to db-url query parms. currently works only for pymssql(link)
[mssql] tested with pymssql 0.8.0 (which is now LGPL)(link)
[oracle] when returning “rowid” as the ORDER BY column or in use with ROW_NUMBER OVER, oracle dialect checks the selectable its being applied to and will switch to table PK if not applicable, i.e. for a UNION. checking for DISTINCT, GROUP BY (other places that rowid is invalid) still a TODO. allows polymorphic mappings to function.(link)
[oracle] sequences on a non-pk column will properly fire off on INSERT(link)
[oracle] added PrefetchingResultProxy support to pre-fetch LOB columns when they are known to be present, fixes(link)
[oracle] implemented reflection of tables based on synonyms, including across dblinks(link)
[oracle] issues a log warning when a related table cant be reflected due to certain permission errors(link)
[postgres] better reflection of sequences for alternate-schema Tables(link)
[postgres] sequences on a non-pk column will properly fire off on INSERT(link)
[postgres] added PGInterval type, PGInet type(link)
[extensions] added distinct() method to SelectResults. generally should only make a difference when using count().(link)
[extensions] added options() method to SelectResults, equivalent to query.options()(link)
[extensions] added optional __table_opts__ dictionary to ActiveMapper, will send kw options to Table objects(link)
[extensions] added selectfirst(), selectfirst_by() to assign_mapper(link)
[general] global “insure”->”ensure” change. in US english “insure” is actually largely interchangeable with “ensure” (so says the dictionary), so I’m not completely illiterate, but its definitely sub-optimal to “ensure” which is non-ambiguous.(link)
[orm] poked the first hole in the can of worms: saying query.select_by(somerelationname=someinstance) will create the join of the primary key columns represented by “somerelationname“‘s mapper to the actual primary key in “someinstance”.(link)
[orm] reworked how relations interact with “polymorphic” mappers, i.e. mappers that have a select_table as well as polymorphic flags. better determination of proper join conditions, interaction with user- defined join conditions, and support for self-referential polymorphic mappers.(link)
[orm] related to polymorphic mapping relations, some deeper error checking when compiling relations, to detect an ambiguous “primaryjoin” in the case that both sides of the relationship have foreign key references in the primary join condition. also tightened down conditions used to locate “relation direction”, associating the “foreignkey” of the relationship with the “primaryjoin”(link)
[orm] a little bit of improvement to the concept of a “concrete” inheritance mapping, though that concept is not well fleshed out yet (added test case to support concrete mappers on top of a polymorphic base).(link)
[orm] fix to “proxy=True” behavior on synonym()(link)
[orm] fixed bug where delete-orphan basically didn’t work with many-to-many relationships, backref presence generally hid the symptom(link)
[orm] added a mutex to the mapper compilation step. ive been reluctant to add any kind of threading anything to SA but this is one spot that its really needed since mappers are typically “global”, and while their state does not change during normal operation, the initial compilation step does modify internal state significantly, and this step usually occurs not at module-level initialization time (unless you call compile()) but at first-request time(link)
[orm] basic idea of “session.merge()” actually implemented. needs more testing.(link)
[orm] added “compile_mappers()” function as a shortcut to compiling all mappers(link)
[orm] fix to MapperExtension create_instance so that entity_name properly associated with new instance(link)
[orm] speed enhancements to ORM object instantiation, eager loading of rows(link)
[orm] invalid options sent to ‘cascade’ string will raise an exception(link)
[orm] fixed bug in mapper refresh/expire whereby eager loaders didnt properly re-populate item lists(link)
[orm] fix to post_update to ensure rows are updated even for non insert/delete scenarios(link)
[orm] added an error message if you actually try to modify primary key values on an entity and then flush it(link)
[sql] added “fetchmany()” support to ResultProxy(link)
[sql] added support for column “key” attribute to be useable in row[<key>]/row.<key>(link)
[sql] changed “BooleanExpression” to subclass from “BinaryExpression”, so that boolean expressions can also follow column-clause behaviors (i.e. label(), etc).(link)
[sql] trailing underscores are trimmed from func.<xxx> calls, such as func.if_()(link)
[sql] fix to correlation of subqueries when the column list of the select statement is constructed with individual calls to append_column(); this fixes an ORM bug whereby nested select statements were not getting correlated with the main select generated by the Query object.(link)
[sql] another fix to subquery correlation so that a subquery which has only one FROM element will not correlate that single element, since at least one FROM element is required in a query.(link)
[sql] default “timezone” setting is now False. this corresponds to Python’s datetime behavior as well as Postgres’ timestamp/time types (which is the only timezone-sensitive dialect at the moment)(link)
[sql] the “op()” function is now treated as an “operation”, rather than a “comparison”. the difference is, an operation produces a BinaryExpression from which further operations can occur whereas comparison produces the more restrictive BooleanExpression(link)
[sql] trying to redefine a reflected primary key column as non-primary key raises an error(link)
[sql] type system slightly modified to support TypeDecorators that can be overridden by the dialect (ok, thats not very clear, it allows the mssql tweak below to be possible)(link)
[mysql] mysql is inconsistent with what kinds of quotes it uses in foreign keys during a SHOW CREATE TABLE, reflection updated to accomodate for all three styles(link)
[mysql] mysql table create options work on a generic passthru now, i.e. Table(..., mysql_engine=’InnoDB’, mysql_collate=”latin1_german2_ci”, mysql_auto_increment=”5”, mysql_<somearg>...), helps(link)
[mssql] added an NVarchar type (produces NVARCHAR), also MSUnicode which provides Unicode-translation for the NVarchar regardless of dialect convert_unicode setting.(link)
[oracle] slight support for binary, but still need to figure out how to insert reasonably large values (over 4K). requires auto_setinputsizes=True sent to create_engine(), rows must be fully fetched individually, etc.(link)
[postgres] fix to the initial checkfirst for tables to take current schema into account(link)
[postgres] postgres has an optional “server_side_cursors=True” flag which will utilize server side cursors. these are appropriate for fetching only partial results and are necessary for working with very large unbounded result sets. While we’d like this to be the default behavior, different environments seem to have different results and the causes have not been isolated so we are leaving the feature off by default for now. Uses an apparently undocumented psycopg2 behavior recently discovered on the psycopg mailing list.(link)
[postgres] added “BIGSERIAL” support for postgres table with PGBigInteger/autoincrement(link)
[postgres] fixes to postgres reflection to better handle when schema names are present; thanks to jason (at) ncsmags.com(link)
[extensions] added “validate=False” argument to assign_mapper, if True will ensure that only mapped attributes are named(link)
[extensions] assign_mapper gets “options”, “instances” functions added (i.e. MyClass.instances())(link)
string-based FROM clauses fixed, i.e. select(..., from_obj=[“sometext”])(link)
fixes to passive_deletes flag, lazy=None (noload) flag(link)
added example/docs for dealing with large collections(link)
added object_session() method to sqlalchemy namespace(link)
fixed QueuePool bug whereby its better able to reconnect to a database that was not reachable (thanks to SÃ©bastien Lelong), also fixed dispose() method(link)
patch that makes MySQL rowcount work correctly!(link)
fix to MySQL catch of 2006/2014 errors to properly re-raise OperationalError exception(link)
major connection pool bug fixed. fixes MySQL out of sync errors, will also prevent transactions getting rolled back accidentally in all DBs(link)
major speed enhancements vs. 0.3.1, to bring speed back to 0.2.8 levels(link)
made conditional dozens of debug log calls that were time-intensive to generate log messages(link)
fixed bug in cascade rules whereby the entire object graph could be unnecessarily cascaded on the save/update cascade(link)
various speedups in attributes module(link)
identity map in Session is by default no longer weak referencing. to have it be weak referencing, use create_session(weak_identity_map=True) fixes(link)
MySQL detects errors 2006 (server has gone away) and 2014 (commands out of sync) and invalidates the connection on which it occured.(link)
MySQL bool type fix:(link)
postgres reflection fixes:(link)
added keywords for EXCEPT, INTERSECT, EXCEPT ALL, INTERSECT ALL(link)
assign_mapper in assignmapper extension returns the created mapper(link)
added label() function to Select class, when scalar=True is used to create a scalar subquery i.e. “select x, y, (select max(foo) from table) AS foomax from table”(link)
added onupdate and ondelete keyword arguments to ForeignKey; propagate to underlying ForeignKeyConstraint if present. (dont propagate in the other direction, however)(link)
fix to session.update() to preserve “dirty” status of incoming object(link)
sending a selectable to an IN via the in_() function no longer creates a “union” out of multiple selects; only one selectable to a the in_() function is allowed now (make a union yourself if union is needed)(link)
improved support for disabling save-update cascade via cascade=”none” etc.(link)
added “remote_side” argument to relation(), used only with self-referential mappers to force the direction of the parent/child relationship. replaces the usage of the “foreignkey” parameter for “switching” the direction. “foreignkey” argument is deprecated for all uses and will eventually be replaced by an argument dedicated to ForeignKey specification on mappers.(link)
[orm] the “delete” cascade will load in all child objects, if they were not loaded already. this can be turned off (i.e. the old behavior) by setting passive_deletes=True on a relation().(link)
[orm] adjustments to reworked eager query generation to not fail on circular eager-loaded relationships (like backrefs)(link)
[orm] fixed bug where eagerload() (nor lazyload()) option didn’t properly instruct the Query whether or not to use “nesting” when producing a LIMIT query.(link)
[orm] fixed bug in circular dependency sorting at flush time; if object A contained a cyclical many-to-one relationship to object B, and object B was just attached to object A, but object B itself wasnt changed, the many-to-one synchronize of B’s primary key attribute to A’s foreign key attribute wouldnt occur.(link)
[orm] implemented from_obj argument for query.count, improves count function on selectresults(link)
[orm] added an assertion within the “cascade” step of ORM relationships to check that the class of object attached to a parent object is appropriate (i.e. if A.items stores B objects, raise an error if a C is appended to A.items)(link)
[orm] new extension sqlalchemy.ext.associationproxy, provides transparent “association object” mappings. new example examples/association/proxied_association.py illustrates.(link)
[orm] improvement to single table inheritance to load full hierarchies beneath the target class(link)
[orm] fix to subtle condition in topological sort where a node could appear twice, for(link)
[orm] additional rework to topological sort, refactoring, for(link)
[orm] “delete-orphan” for a certain type can be set on more than one parent class; the instance is an “orphan” only if its not attached to any of those parents(link)
[engine/pool] some new Pool utility classes, updated docs(link)
[engine/pool] “use_threadlocal” on Pool defaults to False (same as create_engine)(link)
[engine/pool] fixed direct execution of Compiled objects(link)
[engine/pool] create_engine() reworked to be strict about incoming **kwargs. all keyword arguments must be consumed by one of the dialect, connection pool, and engine constructors, else a TypeError is thrown which describes the full set of invalid kwargs in relation to the selected dialect/pool/engine configuration.(link)
[databases/types] MySQL catches exception on “describe” and reports as NoSuchTableError(link)
[databases/types] further fixes to sqlite booleans, weren’t working as defaults(link)
[databases/types] fix to postgres sequence quoting when using schemas(link)
[general] logging is now implemented via standard python “logging” module. “echo” keyword parameters are still functional but set/unset log levels for their respective classes/instances. all logging can be controlled directly through the Python API by setting INFO and DEBUG levels for loggers in the “sqlalchemy” namespace. class-level logging is under “sqlalchemy.<module>.<classname>”, instance-level logging under “sqlalchemy.<module>.<classname>.0x..<00-FF>”. Test suite includes “–log-info” and “–log-debug” arguments which work independently of –verbose/–quiet. Logging added to orm to allow tracking of mapper configurations, row iteration.(link)
[general] the documentation-generation system has been overhauled to be much simpler in design and more integrated with Markdown(link)
[orm] attribute tracking modified to be more intelligent about detecting changes, particularly with mutable types. TypeEngine objects now take a greater role in defining how to compare two scalar instances, including the addition of a MutableType mixin which is implemented by PickleType. unit-of-work now tracks the “dirty” list as an expression of all persistent objects where the attribute manager detects changes. The basic issue thats fixed is detecting changes on PickleType objects, but also generalizes type handling and “modified” object checking to be more complete and extensible.(link)
[orm] a wide refactoring to “attribute loader” and “options” architectures. ColumnProperty and PropertyLoader define their loading behaivor via switchable “strategies”, and MapperOptions no longer use mapper/property copying in order to function; they are instead propagated via QueryContext and SelectionContext objects at query/instances time. All of the internal copying of mappers and properties that was used to handle inheritance as well as options() has been removed; the structure of mappers and properties is much simpler than before and is clearly laid out in the new ‘interfaces’ module.(link)
[orm] related to the mapper/property overhaul, internal refactoring to mapper instances() method to use a SelectionContext object to track state during the operation. SLIGHT API BREAKAGE: the append_result() and populate_instances() methods on MapperExtension have a slightly different method signature now as a result of the change; hoping that these methods are not in widespread use as of yet.(link)
[orm] instances() method moved to Query now, backwards-compatible version remains on Mapper.(link)
[orm] added contains_eager() MapperOption, used in conjunction with instances() to specify properties that should be eagerly loaded from the result set, using their plain column names by default, or translated given an custom row-translation function.(link)
[orm] more rearrangements of unit-of-work commit scheme to better allow dependencies within circular flushes to work properly...updated task traversal/logging implementation(link)
[orm] polymorphic mappers (i.e. using inheritance) now produces INSERT statements in order of tables across all inherited classes(link)
[orm] added an automatic “row switch” feature to mapping, which will detect a pending instance/deleted instance pair with the same identity key and convert the INSERT/DELETE to a single UPDATE(link)
[orm] “association” mappings simplified to take advantage of automatic “row switch” feature(link)
[orm] “custom list classes” is now implemented via the “collection_class” keyword argument to relation(). the old way still works but is deprecated(link)
[orm] added “viewonly” flag to relation(), allows construction of relations that have no effect on the flush() process.(link)
[orm] added “lockmode” argument to base Query select/get functions, including “with_lockmode” function to get a Query copy that has a default locking mode. Will translate “read”/”update” arguments into a for_update argument on the select side.(link)
[orm] implemented “version check” logic in Query/Mapper, used when version_id_col is in effect and query.with_lockmode() is used to get() an instance thats already loaded(link)
[orm] post_update behavior improved; does a better job at not updating too many rows, updates only required columns(link)
[orm] adjustments to eager loading so that its “eager chain” is kept separate from the normal mapper setup, thereby preventing conflicts with lazy loader operation, fixes(link)
[orm] fix to deferred group loading(link)
[orm] session.flush() wont close a connection it opened(link)
[orm] added “batch=True” flag to mapper; if False, save_obj will fully save one object at a time including calls to before_XXXX and after_XXXX(link)
[orm] added “column_prefix=None” argument to mapper; prepends the given string (typically ‘_’) to column-based attributes automatically set up from the mapper’s Table(link)
[orm] specifying joins in the from_obj argument of query.select() will replace the main table of the query, if the table is somewhere within the given from_obj. this makes it possible to produce custom joins and outerjoins in queries without the main table getting added twice.(link)
[orm] eagerloading is adjusted to more thoughtfully attach its LEFT OUTER JOINs to the given query, looking for custom “FROM” clauses that may have already been set up.(link)
[orm] added join_to and outerjoin_to transformative methods to SelectResults, to build up join/outerjoin conditions based on property names. also added select_from to explicitly set from_obj parameter.(link)
[orm] removed “is_primary” flag from mapper.(link)
[sql] [construction] changed “for_update” parameter to accept False/True/”nowait” and “read”, the latter two of which are interpreted only by Oracle and Mysql(link)
[sql] [construction] added extract() function to sql dialect (SELECT extract(field FROM expr))(link)
[sql] [construction] BooleanExpression includes new “negate” argument to specify the appropriate negation operator if one is available.(link)
[sql] [construction] calling a negation on an “IN” or “IS” clause will result in “NOT IN”, “IS NOT” (as opposed to NOT (x IN y)).(link)
[sql] [construction] Function objects know what to do in a FROM clause now. their behavior should be the same, except now you can also do things like select([‘*’], from_obj=[func.my_function()]) to get multiple columns from the result, or even use sql.column() constructs to name the return columns(link)
[schema] a fair amount of cleanup to the schema package, removal of ambiguous methods, methods that are no longer needed. slightly more constrained useage, greater emphasis on explicitness(link)
[schema] the “primary_key” attribute of Table and other selectables becomes a setlike ColumnCollection object; is ordered but not numerically indexed. a comparison clause between two pks that are derived from the same underlying tables (i.e. such as two Alias objects) can be generated via table1.primary_key==table2.primary_key(link)
[schema] ForeignKey(Constraint) supports “use_alter=True”, to create/drop a foreign key via ALTER. this allows circular foreign key relationships to be set up.(link)
[schema] append_item() methods removed from Table and Column; preferably construct Table/Column/related objects inline, but if needed use append_column(), append_foreign_key(), append_constraint(), etc.(link)
[schema] table.create() no longer returns the Table object, instead has no return value. the usual case is that tables are created via metadata, which is preferable since it will handle table dependencies.(link)
[schema] added UniqueConstraint (goes at Table level), CheckConstraint (goes at Table or Column level).(link)
[schema] index=False/unique=True on Column now creates a UniqueConstraint, index=True/unique=False creates a plain Index, index=True/unique=True on Column creates a unique Index. ‘index’ and ‘unique’ keyword arguments to column are now boolean only; for explcit names and groupings of indexes or unique constraints, use the UniqueConstraint/Index constructs explicitly.(link)
[schema] added autoincrement=True to Column; will disable schema generation of SERIAL/AUTO_INCREMENT/identity seq for postgres/mysql/mssql if explicitly set to False(link)
[schema] TypeEngine objects now have methods to deal with copying and comparing values of their specific type. Currently used by the ORM, see below.(link)
[schema] fixed condition that occurred during reflection when a primary key column was explciitly overridden, where the PrimaryKeyConstraint would get both the reflected and the programmatic column doubled up(link)
[schema] the “foreign_key” attribute on Column and ColumnElement in general is deprecated, in favor of the “foreign_keys” list/set-based attribute, which takes into account multiple foreign keys on one column. “foreign_key” will return the first element in the “foreign_keys” list/set or None if the list is empty.(link)
[oracle] Oracle has experimental support for cx_Oracle.TIMESTAMP, which requires a setinputsizes() call on the cursor that is now enabled via the ‘auto_setinputsizes’ flag to the oracle dialect.(link)
[ms-sql] fixes bug 261 (table reflection broken for MS-SQL case-sensitive databases)(link)
[ms-sql] can now specify port for pymssql(link)
[ms-sql] introduces new “auto_identity_insert” option for auto-switching between “SET IDENTITY_INSERT” mode when values specified for IDENTITY columns(link)
[ms-sql] now supports multi-column foreign keys(link)
[ms-sql] fix to reflecting date/datetime columns(link)
[ms-sql] NCHAR and NVARCHAR type support added(link)
[connections/pooling/execution] connection pool tracks open cursors and automatically closes them if connection is returned to pool with cursors still opened. Can be affected by options which cause it to raise an error instead, or to do nothing. fixes issues with MySQL, others(link)
[connections/pooling/execution] fixed bug where Connection wouldnt lose its Transaction after commit/rollback(link)
[connections/pooling/execution] added scalar() method to ComposedSQLEngine, ResultProxy(link)
[connections/pooling/execution] ResultProxy will close() the underlying cursor when the ResultProxy itself is closed. this will auto-close cursors for ResultProxy objects that have had all their rows fetched (or had scalar() called).(link)
[connections/pooling/execution] ResultProxy.fetchall() internally uses DBAPI fetchall() for better efficiency, added to mapper iteration as well (courtesy Michael Twomey)(link)


The surname data comes from the United States Social Security Administration (SSA). This data has the number of people with that name that are identified as female or male so the probability female/male is the proportion of all people with that name that are female/male. SSA data is available annually from 1880-2019, this aggregates all years together.
predict_gender(name, probability = TRUE)
| name | String or vector of strings of the first name that you want to know the gender of. |
|---|---|
| probability | If TRUE (default) will provide columns for each race with the probability that the first name is of that gender If FALSE, will only return the name, the match-name from the SSA data, and the most likely gender. |
A data.frame with three or nine columns: The first column has the name as inputted, the second column has the cleaned up name (no spaces or punctuation, all lowercase), the third column tells the likely gender of the first name (if there are multiple genders with the same probability of a match, it will be a string with each race separated by a comma). If the parameter probability is false, these three columns are all that is returned.


[MANPOWER DEVELOPMENT AND TRAINING]
[§202-21 Participation in federal program.] The department of labor and industrial relations and the University of Hawaii are authorized to participate in the Manpower Development and Training Act of 1962, as amended, by providing from funds appropriated by the legislature for such purpose, in accordance with and to the extent required by the federal act, amounts necessary to match the amounts expended by the United States Treasury. [L 1964, c 11, §2; am L 1965, c 23, §1; am L 1968, c 71, §5; HRS §202-21]
Cross References
Establishment of manpower development and training programs, see chapter 394.


This year, Creative Commons launched a new communication tool to improve the chapters work around the world. The rationale behind this tool is to "Ensure the network is creating value for members" providing a site network that try to be a useful and easy to use tool for the Creative Commons chapters.
Technology
This network was built in WordPress in its "Multisite" mode. This means we can create multiple websites with a single Wordpress install, this has a lot of benefits in terms of administration and visual consistency.
CC Netherlands homepage from beta testing stage
Theme
The work behind this network is based in a single WordPress theme which is assigned by default in every new site created. This theme uses all the capabilities availables on WordPress such as Custom post types
, Custom Taxonomies
, Widgets
, Metaboxes
and so on. To ease the backend development work I choose a Development Toolkit for WordPress named Queulat, which provide a lot of powerful tools to create and maintain Custom Post types and its own queries, metabox creation and a powerful form factory with many useful elements.
The theme file structure is aim to be as logical as posible and following the recommended structure from WordPress in order to keep the files in a semantic order ready for community colaboration.
The theme front page was built using sidebars and widgets in order to increase its flexibility, there are a lot of widgets for each website content which can be configured and placed into homepage sidebars and splitted in columns as needed.
Event Post type with custom data metabox
Gutenberg
The new WordPress editor is a whole new experience for me, as they say "We call the new editor Gutenberg. The entire editing experience has been rebuilt for media rich pages and posts. Experience the flexibility that blocks will bring, whether you are building your first site, or write code for a living." I decide to take advantage of this new feature by creating customizations for the websites like custom styles, a custom color palette for button block, and responsive support for most common Gutenberg blocks to keep the content as flexible as posible
Gutenberg custom button block
Frontend
Thinking on scalability and maintenance I like to build website styles using SASS preprocessor. For layout, I like to modularize elements and use a standardizing format like the Microformats specification (in this case hAtom), this helps new developers to understand the layout and the code in a better way and also helps to optimize crawling from search engines.
The future
We're working on improve this website network and pushing forward a lot of new features requested by the community. They can be tracked here. Some of the most important features in the future will be:
- CCsearch Integration
- Easy Attribution
- Post formats compatibility (Image, video, gallery)
- More post types and widgets
Also, we're planning on providing the chapters data via the WP-API so it can be used in other CC websites (The CC Global Network for instance), so we can show information from what's going on in the whole network


For your convenience, we have provided downloadable versions of all of the necessary paperwork below. Filling out these forms prior to your first visit will greatly speed up the admissions process and allow us to give you the care you need as quickly as possible.
You must have Adobe Reader® installed in order to view the documents. To download, click here.


Columbia ends 15-game losing streak to Harvard, 17-10 in OT
by EndPlayNEW YORK (AP) - Mike Roussos scored from 1-yard out to start overtime, Ben Mathiasmeier intercepted a pass on the next offensive play and Columbia beat Harvard 17-10 on Saturday to end a 15-game losing streak in the series.
Columbia (3-5, 2-3 Ivy League) beat Harvard for the first time since a 16-13 victory at Wien Stadium on November 8, 2003.
Columbia went on an 11-play drive late in the fourth quarter but stalled at Harvard's 8 and Alex Felkins made a short field goal to tie it at 10. The Crimson went three-and-out and the Lions got it back at their 30 with 1:22 left but chose to run out the clock.
Brogan McPartland highlighted overtime with a 25-yard grab to Harvard's 1 on third-and-11.
Ty Lenhart completed 17 of 25 passes for 153 yards and one touchdown for Columbia. He also carried it 19 times for 50 yards.
Jake Smith threw for 111 yards and a touchdown and Jake McIntyre added a shot field goal for Harvard (4-4, 2-3).


2.1 Continuous Variables and Eliciting Probability Distributions
Missing: Continuous random variable’s pdf plot in 2.1.1
2.1.1 From the Discrete to the Continuous
This section leads the reader from the discrete random variable to continuous random variables. Let’s start with the binomial random variable such as the number of heads in ten coin tosses, can only take a discrete number of values – 0, 1, 2, up to 10.
When the probability of a coin landing heads is \(p\), the chance of getting \(k\) heads in \(n\) tosses is
\[P(X = k) = \left( \begin{array}{c} n \\ k \end{array} \right) p^k (1-p)^{n-k}\].
This formula is called the probability mass function (pmf) for the binomial.
The probability mass function can be visualized as a histogram in Figure 2.1. The area under the histogram is one, and the area of each bar is the probability of seeing a binomial random variable, whose value is equal to the x-value at the center of the bars base.
In contrast, the normal distribution, a.k.a. Gaussian distribution or the bell-shaped curve, can take any numerical value in \((-\infty,+\infty)\). A random variable generated from a normal distribution because it can take a continuum of values.
In general, if the set of possible values a random variable can take are separated points, it is a discrete random variable. But if it can take any value in some (possibly infinite) interval, then it is a continuous random variable.
When the random variable is discrete, it has a probability mass function or pmf. That pmf tells us the probability that the random variable takes each of the possible values. But when the random variable is continuous, it has probability zero of taking any single value. (Hence probability zero does not equal to impossible, an event of probabilty zero can still happen.)
We can only talk about the probability of a continuous random variable lined within some interval. For example, suppose that heights are approximately normally distributed. The probability of finding someone who is exactly 6 feet tall at 0.0000 inches tall for an infinite number of 0s after the decimal point is 0. But we can easily calculate the probability of finding someone who is between 5’11" inches tall and 6’1" inches tall.
A continuous random variable has a probability density function or pdf, instead of probability mass functions. The probability of finding someone whose height lies between 5’11" and 6’1" is the area under the pdf curve for height between those two values.
NEED TO GET THE PLOTS HERE
For example, a normal distribution with mean \(\mu\) and standard deviation \(\sigma\) (i.e., variance \(\sigma^2\)) is defined as
\[f(x) = \frac{1}{\sqrt{2 \pi \sigma^2}} \exp[-\frac{1}{2\sigma^2}(x-\mu)^2],\]
where \(x\) is any value the random variable \(X\) can take. This is denoted as \(X \sim N(\mu,\sigma^2)\), where \(\mu\) and \(\sigma^2\) are the parameters of the normal distribution.
Recall that a probability mass function assigns the probability that a random variable takes a specific value for the discrete set of possible values. The sum of those probabilities over all possible values must equal one.
Similarly, a probability density function is any \(f(x)\) that is non-negative and has area one underneath its curve. The pdf can be regarded as the limit of histograms made from its sample data. As the sample size becomes infinitely large, the bin width of the histogram shrinks to zero.
There are infinite number of pmf’s and an infinite number of pdf’s. Some distributions are so important that they have been given names:
Continuous: normal, uniform, beta, gamma
Discrete: binomial, Poisson
Here is a summary of the key ideas in this section:
Continuous random variables exist and they can take any value within some possibly infinite range.
The probability that a continuous random variable takes a specific value is zero.
Probabilities from a continuous random variable are determined by the density function with this non-negative and the area beneath it is one.
We can find the probability that a random variable lies between two values (\(c\) and \(d\)) as the area under the density function that lies between them.
2.1.2 Elicitation
Next, we introduce the concept of prior elicitation in base and statistics. Often, one has a belief about the distribution of one’s data. You may think that your data come from a binomial distribution and in that case you typically know the \(n\), the number of trials but you usually do not know \(p\), the probability of success. Or you may think that your data come from a normal distribution. But you do not know the mean \(\mu\) or the standard deviation \(\sigma\) of the normal. Beside to knowing the distribution of one’s data, you may also have beliefs about the unknown \(p\) in the binomial or the unknown mean \(\mu\) in the normal.
Bayesians express their belief in terms of personal probabilities. These personal probabilities encapsulate everything a Bayesian knows or believes about the problem. But these beliefs must obey the laws of probability, and be consistent with everything else the Bayesian knows.
So a base angle sits to express their belief about the value of \(p\) through a probability distribution, and a very flexible family of distributions for this purpose is the beta family. A member of the beta family is specified by two parameters, \(\alpha\) and \(\beta\); we denote this as \(p \sim \text{beta}(\alpha, \beta)\). The probability density function is
\[\begin{equation} f(p) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} p^{\alpha-1} (1-p)^{\beta-1}, \tag{2.1} \end{equation}\]where \(0 \leq p \leq 1, \alpha>0, \beta>0\), and \(\Gamma\) is a factorial:
\[\Gamma(n) = (n-1)! = (n-1) \times (n-2) \times \cdots \times 1\]
When \(\alpha=\beta=1\), the beta distribution becomes a uniform distribution, i.e. the probabilty density function is a flat line. In other words, the uniform distribution is a special case of the beta family.
The expected value of \(p\) is \(\frac{\alpha}{\alpha+\beta}\), so \(\alpha\) can be regarded as the prior number of successes, and \(\beta\) the prior number of failures. When \(\alpha=\beta\), then one gets a symmetrical pdf around 0.5. For large but equal values of \(\alpha\) and \(\beta\), the area under the beta probability density near 0.5 is very large. Figure 2.2 compares the beta distribution with different parameter values.
These kinds of priors are probably appropriate if you want to infer the probability of getting heads in a coin toss. The beta family also includes skewed densities, which is appropriate if you think that \(p\) the probability of success in ths binomial trial is close to zero or one.
Bayes’ rule is a machine to turn one’s prior beliefs into posterior beliefs. With binomial data you start with whatever beliefs you may have about \(p\), then you observe data in the form of the number of head, say 20 tosses of a coin with 15 heads.
Next, Bayes’ rule tells you how the data changes your opinion about \(p\). The same principle applies to all other inferences. You start with your prior probability distribution over some parameter, then you use data to update that distribution to become the posterior distribution that expresses your new belief.
These rules ensure that the change in distributions from prior to posterior is the uniquely rational solution. So, as long as you begin with the prior distribution that reflects your true opinion, you can hardly go wrong.
However, expressing that prior can be difficult. There are proofs and methods whereby a rational and coherent thinker can self-illicit their true prior distribution, but these are impractical and people are rarely rational and coherent.
The good news is that with the few simple conditions no matter what part distribution you choose. If enough data are observed, you will converge to an accurate posterior distribution. So, two bayesians, say the reference Thomas Bayes and the agnostic Ajay Good can start with different priors but, observe the same data. As the amount of data increases, they will converge to the same posterior distribution.
Here is a summary of the key ideas in this section:
Bayesians express their uncertainty through probability distributions.
One can think about the situation and self-elicit a probability distribution that approximately reflects his/her personal probability.
One’s personal probability should change according Bayes’ rule, as new data are observed.
The beta family of distribution can describe a wide range of prior beliefs.
2.1.3 Conjugacy
Next, let’s introduce the concept of conjugacy in Bayesian statistics.
Suppose we have the prior beliefs about the data as below:
Binomial distribution \(\text{Bin}(n,p)\) with \(n\) known and \(p\) unknown
Prior belief about \(p\) is \(\text{beta}(\alpha,\beta)\)
Then we observe \(x\) success in \(n\) trials, and it turns out the Bayes’ rule implies that our new belief about the probability density of \(p\) is also the beta distribution, but with different parameters. In mathematical terms,
\[\begin{equation} p|x \sim \text{beta}(\alpha+x, \beta+n-x). \tag{2.2} \end{equation}\]This is an example of conjugacy. Conjugacy occurs when the posterior distribution is in the same family of probability density functions as the prior belief, but with new parameter values, which have been updated to reflect what we have learned from the data.
Why are the beta binomial families conjugate? Here is a mathematical explanation.
Recall the discrete form of the Bayes’ rule:
\[P(A_i|B) = \frac{P(B|A_i)P(A_i)}{\sum^n_{j=1}P(B|A_j)P(A_j)}\]
However, this formula does not apply to continuous random variables, such as the \(p\) which follows a beta distribution, because the denominator sums over all possible values (must be finitely many) of the random variable.
But the good news is that the \(p\) has a finite range – it can tak any value only between 0 and 1. Hence we can perform integration, which is a generalization of the summation. The Bayes’ rule can also be written in continuous form as:
\[\pi^*(p|x) = \frac{P(x|p)\pi(p)}{\int^1_0 P(x|p)\pi(p) dp}.\]
This is analogus to the discrete form, since the integral in the denominator will also be equal to some constant, just like a summation. This constant ensures that the total area under the curve, i.e. the posterior density function, equals 1.
Note that in the numerator, the first term, \(P(x|p)\), is the data likelihood – the probability of observing the data given a specific value of \(p\). The second term, \(\pi(p)\), is the probability density function that reflects the prior belief about \(p\).
In the beta-binomial case, we have \(P(x|p)=\text{Bin}(n,p)\) and \(\pi(p)=\text{beta}(\alpha,\beta)\).
Plugging in these distributions, we get
\[\begin{aligned} \pi^*(p|x) &= \frac{1}{\text{some number}} \times P(x|p)\pi(p) \\ &= \frac{1}{\text{some number}} [\left( \begin{array}{c} n \\ x \end{array} \right) p^x (1-p)^{n-x}] [\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} p^{\alpha-1} (1-p)^{\beta-1}] \\ &= \frac{\Gamma(\alpha+\beta+n)}{\Gamma(\alpha+x)\Gamma(\beta+n-x)} \times p^{\alpha+x-1} (1-p)^{\beta+n-x-1} \end{aligned}\]
Let \(\alpha^* = \alpha + x\) and \(\beta^* = \beta+n-x\), and we get
\[\pi^*(p|x) = \text{beta}(\alpha^*,\beta^*) = \text{beta}(\alpha+x, \beta+n-x),\]
same as the posterior formula in Equation (2.2).
We can recognize the posterior distribution from the numerator \(p^{\alpha+x-1}\) and \((1-p)^{\beta+n-x-1}\). Everything else are just constants, and they must take the unique value, which is needed to ensure that the area under the curve between 0 and 1 equals 1. So they have to take the values of the beta, which has parameters \(\alpha+x\) and \(\beta+n-x\).
This is a cute trick. We can find the answer without doing the integral simply by looking at form of the numerator.
Without conjugacy, one has to do the integral. Often, the integral is impossible to evaluate. That obstacle is the primary reason that most statistical theory in the 20th century was not Bayesian. The situation didn’t change until modern computing allowed researchers to compute integrals numerically.
In summary, some pairs of distributions are conjugate. If your prior is in one and your data comes from the other, then your posterior is in the same family as the prior, but with new parameters. We explored this in the context of the beta-binomial conjugate families. And we saw that conjugacy meant that we could apply the continuous version of Bayes’ rule without having to do any integration.


Look at the headers in Network Inspector and see the x-modified-edge Response header!
x-modified-edge


Open Pampas [at19], plain, in Mandoria, wilderness ------------------------------------------------------------------------ Routes leaving Open Pampas: North, plain, to Open Pampas [as19], 7 days East, plain, to Open Pampas [at20], 7 days South, plain, to Open Pampas [au19], 7 days West, plain, to Open Pampas [at18], 7 days Seen here: Stack of giants [eq2j], giants, number: 14


Note: To complete the procedures in this document, you must be assigned a role having the necessary permissions. To determine your role, follow the directions in Participant roles. To view a list of permissions associated with a given role, see Permissions, roles, and tools. For a basic understanding of roles and permissions, see Permissions and Roles: Overview.
To add a text description to your site, follow these steps:
Site Info
.
Edit Site Information
.
Continue
, and then click Finish
.
Note: Your Worksite Information box may be configured to display a web page instead of your site description. If so, you will need to change your Worksite Information settings. For more information, see Adding content to the Worksite Information box.


from __future__ import absolute_import, division, print_function
import gains as genetic
from rdkit.Chem import AllChem as Chem
from rdkit.ML.Descriptors.MoleculeDescriptors import\
MolecularDescriptorCalculator as calculator
from rdkit.Chem.rdmolfiles import MolToPDBFile
import numpy as np
from numpy import array
import pandas as pd
import datetime
import salty
from math import exp
import random
[docs]def generate_solvent(target, model_ID, heavy_atom_limit=50,
sim_bounds=[0.4, 1.0], hits=1, write_file=False):
"""
the primary public function of the salt_generator module
Parameters
----------
target : array, float, or int
the desired property value to be achieved by the engine, if
an array, a multi-output model must be supplied to the engine
model_ID : str
the name of the model to be used by the engine. Gains has
several built-in models to choose from
heavy_atom_limit : int, optional
the upper value for allowable heavy atoms in the returned
candidate
sim_bounds : array, optional
the tanimoto similarity score between the returned candidate
and its closest molecular relative in parent_candidates
hits : int, optional
the number of desired solutions
write_file : boolean, optional
defaults to False. if True will return the solutions and a
csv log file
Returns
-------
new : object
default behavior is to return a pandas DataFrame. This is
a log file of the solution(s). if write_file = True the
function will also return pdb files of the solutions
"""
parent_candidates = eval(genetic.load_data("{}_summary.csv".
format(model_ID)).loc[1][1])
anion_candidates = eval(genetic.load_data("{}_summary.csv".
format(model_ID)).loc[2][1])
cols = ["Salt ID", "Salt Smiles", "Cation Heavy Atoms",
"Tanimoto Similarity Score", "Molecular Relative", "Anion",
"Model Prediction", "MD Calculation", "Error"]
salts = pd.DataFrame(columns=cols)
for i in range(1, hits + 1):
while True:
anion_smiles = random.sample(list(anion_candidates), 1)[0]
anion = Chem.MolFromSmiles(anion_smiles)
best = _guess_password(target, anion, parent_candidates, model_ID)
tan_sim_score, sim_index =\
genetic.molecular_similarity(best, parent_candidates)
cation_heavy_atoms = best.Mol.GetNumAtoms()
salt_smiles = best.Genes + "." + Chem.MolToSmiles(anion)
if cation_heavy_atoms < heavy_atom_limit and\
tan_sim_score >= sim_bounds[0] and\
tan_sim_score < sim_bounds[1] and\
salt_smiles not in salts["Salt Smiles"]:
scr, pre = _get_fitness(anion, best.Genes, target, model_ID)
if i < 10:
CAT_ID = "C0%s" % i
AN_ID = "A0%s" % i
else:
CAT_ID = "C%s" % i
AN_ID = "A%s" % i
salt_ID = CAT_ID + "_" + AN_ID
molecular_relative = salty.check_name(parent_candidates
[sim_index])
anion_name = salty.check_name(anion_smiles)
new_entry = pd.DataFrame([[salt_ID, salt_smiles,
cation_heavy_atoms,
tan_sim_score,
molecular_relative,
anion_name, pre]],
columns=cols[:-2])
try:
cation = Chem.AddHs(best.Mol)
Chem.EmbedMolecule(cation, Chem.ETKDG())
Chem.UFFOptimizeMolecule(cation)
anion = Chem.AddHs(anion)
Chem.EmbedMolecule(anion, Chem.ETKDG())
Chem.UFFOptimizeMolecule(anion)
new = pd.DataFrame(pd.concat([salts, new_entry]),
columns=cols)
except BaseException:
continue
if write_file:
MolToPDBFile(cation,
"{}.pdb".format(CAT_ID))
MolToPDBFile(anion,
"{}.pdb".format(AN_ID))
break
else:
continue
if write_file:
pd.DataFrame.to_csv(new, path_or_buf="salt_log.csv", index=False)
salts = new
if not write_file:
return new
def _guess_password(target, anion, parent_candidates, model_ID):
"""
for interacting with the main engine. Contains helper functions
to pass to the engine what it expects
"""
startTime = datetime.datetime.now()
def fnGetFitness(genes):
return _get_fitness(anion, genes, target, model_ID)
def fndisplay(candidate, mutation):
_display(candidate, mutation, startTime)
def fnShowIon(genes, target, mutation_attempts, sim_score,
molecular_relative):
_show_ion(genes, target, mutation_attempts, sim_score,
molecular_relative, model_ID, anion)
optimalFitness = 0.99
geneSet = genetic.generate_geneset()
best = genetic.get_best(fnGetFitness,
optimalFitness, geneSet, fndisplay,
fnShowIon, target, parent_candidates)
return best
def _display(candidate, mutation, startTime):
"""
for printing results to the screen. _display is called for every
accepted mutation
"""
timeDiff = datetime.datetime.now() - startTime
print("{}\t{}\t{}".format(
candidate.Genes, candidate.Fitness, mutation, timeDiff))
def _get_fitness(anion, genes, target, model_ID):
"""
the fitness function passed to the engine. In this case fitness
is determined by a model developed by the salty module. It is
important to note that the fitness function can handle multi-
output models
"""
cation = Chem.MolFromSmiles(genes)
model = genetic.load_data("{}.sav".format(model_ID), pickleFile=True)
deslist = genetic.load_data("{}_descriptors.csv".format(model_ID))
feature_vector = []
for item in deslist:
if "anion" in item:
with genetic.suppress_rdkit_sanity():
feature_vector.append(calculator([item.partition('-')
[0]]).CalcDescriptors(anion)[0])
elif "cation" in item:
with genetic.suppress_rdkit_sanity():
feature_vector.append(calculator([item.partition('-')
[0]]).CalcDescriptors(cation)[0])
elif "Temperature, K" in item:
feature_vector.append(298.15)
elif "Pressure, kPa" in item:
feature_vector.append(101.325)
else:
print("unknown descriptor in list: %s" % item)
features_normalized = (feature_vector - deslist.iloc[0].values) /\
deslist.iloc[1].values
prediction = np.round(np.exp(model.predict(np.array(features_normalized).
reshape(1, -1))[0]), decimals=2)
error = abs((prediction - target) / target)
error = np.average(error)
return 1 - error, prediction
def _show_ion(genes, target, mutation_attempts, sim_score, molecular_relative,
model_ID, anion):
"""
for printing results to the screen. _show_ion is called when a candidate
has achieved the desired fitness core and is returned by the engine
"""
mol = Chem.MolFromSmiles(genes)
fitness, mol_property = _get_fitness(anion, genes, target, model_ID)
print("{}\t{}".format("number of atoms: ", mol.GetNumAtoms()))
print("{}\t{}".format("mutation attempts: ", mutation_attempts))
print("with prediction: \t{}".format(mol_property))
print("similarity score: {0:10.3f}".format(sim_score))
print("{}\t{}\n".format("molecular relative: ",
salty.check_name(molecular_relative)))


The Share API provides methods for sharing content in any sharing-enabled apps the user may have installed.
The Share API works on iOS, Android, and the Web (using the new Web Share API), though web support is currently spotty.
import { Plugins } from '@capacitor/core';
const { Share } = Plugins;
let shareRet = await Share.share({
title: 'See cool stuff',
text: 'Really awesome thing you need to see right meow',
url: 'http://ionicframework.com/',
dialogTitle: 'Share with buddies'
});
Each platform uses a different set of fields, but you should supply them all.


API Documentation¶
-
statseg.
complexity
(sequence, N)[source]¶ Computes the Shannon Entropy of a given sequence of a biopolymer with N possible residues. See (Wooton, 1993) for more.
Parameters: - sequence – the nucleotide or protein sequence whose Shannon Entropy is to calculated.
- N – the total number of possible residues in the biopolymer sequence belongs to.
-
statseg.
compute_rep_vector
(sequence, N)[source]¶ Computes the repetition vector (as seen in Wooton, 1993) from a given sequence of a biopolymer with N possible residues.
Parameters: - sequence – the nucleotide or protein sequence to generate a repetition vector for.
- N – the total number of possible residues in the biopolymer sequence belongs to.
-
statseg.
mask_low_complexity
(seq_rec, maskchar='x', N=20, L=12)[source]¶ Masks low-complexity nucleic/amino acid sequences with a given mask character.
Parameters: - seq_rec – a Biopython Sequence Record
- maskchar – Character to mask low-complexity residues with.
- N – Number of residues to expect in the sequence. (20 for AA, 4 for DNA)
- L – Length of sliding window that reads the sequence.


Celebrate Our Small Victories...
Because they are just as important as our milestones.
Examples
- made my bed
- watered the garden
- walked the dog
- fed the cat
- did my homework
- had a good nap
- enjoyed the concert
- watched a good documentary
- went to bed before the midnight
- worked out for 10 minutes
- took a walk
- called mom
- called dad
- sent a gift to my cousin
- studied for 20 minutes
- stayed on budget this week
- got a haircut
- got a carwash
- got a praise from someone
- answered a question on Piazza
- made lunch
- made breakfast
- took vitamins
- donated clothes
- finished homework early
- had a good weather
- cleaned the hamster's home