Skip to content

Commit

Permalink
release 0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xflr6 committed Apr 9, 2020
1 parent 1f5283f commit a6ccd26
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 54 deletions.
7 changes: 5 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ Changelog
=========


Version 0.8.2 (in development)
------------------------------
Version 0.8.2
-------------

Add ``example`` view with ``treedb.get_query()``.

Reorganized `treedb.load()` to better support repeated changes to
`exclude_views`.


Version 0.8.1
Expand Down
84 changes: 36 additions & 48 deletions Stats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
"data": {
"text/plain": [
"'0.8.1'"
"'0.8.2'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -90,7 +90,7 @@
"output_type": "stream",
"text": [
"CompletedProcess(args=['git', 'checkout', '-B', 'treedb', 'v4.1'], returncode=0)\n",
"Wall time: 36.4 s\n"
"Wall time: 35.2 s\n"
]
}
],
Expand Down Expand Up @@ -138,7 +138,7 @@
{
"data": {
"text/plain": [
"<treedb.proxies.PathProxy path='../glottolog/languoids/tree' inode=33495522228963974>"
"<treedb.proxies.PathProxy path='../glottolog/languoids/tree' inode=31525197391987014>"
]
},
"execution_count": 3,
Expand All @@ -158,7 +158,7 @@
{
"data": {
"text/plain": [
"(('abin1243',), <DirEntry 'md.ini'>, <treedb.files.ConfigParser at 0x50c2fa0>)"
"(('abin1243',), <DirEntry 'md.ini'>, <treedb.files.ConfigParser at 0x50f0fa0>)"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -294,14 +294,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0:01:39.752706\n",
"Wall time: 1min 39s\n"
"0:02:00.202875\n",
"Wall time: 2min\n"
]
},
{
"data": {
"text/plain": [
"<treedb.proxies.SQLiteEngineProxy filename='treedb.sqlite3' size=101441536>"
"<treedb.proxies.SQLiteEngineProxy filename='treedb.sqlite3' size=101453824>"
]
},
"execution_count": 7,
Expand All @@ -324,7 +324,7 @@
{
"data": {
"text/plain": [
"datetime.datetime(2020, 4, 8, 22, 4, 38, 334364)"
"datetime.datetime(2020, 4, 9, 17, 56, 34, 340523)"
]
},
"execution_count": 8,
Expand All @@ -344,7 +344,7 @@
{
"data": {
"text/plain": [
"96.7421875"
"96.75390625"
]
},
"execution_count": 9,
Expand All @@ -365,13 +365,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 675 ms\n"
"Wall time: 742 ms\n"
]
},
{
"data": {
"text/plain": [
"'a069a127a9c192809e065ed1acf7980af689f0c780f5b08dcd09d79c40c91ee5'"
"'49e36b51aa6c2dc7c4b46ce0f156125e25a3f7c10ab98083c7fd02595d32d82f'"
]
},
"execution_count": 10,
Expand All @@ -392,7 +392,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 352 ms\n"
"Wall time: 459 ms\n"
]
},
{
Expand All @@ -419,7 +419,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 9.13 s\n"
"Wall time: 9.45 s\n"
]
},
{
Expand All @@ -446,7 +446,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 9.31 s\n"
"Wall time: 9.46 s\n"
]
},
{
Expand Down Expand Up @@ -484,7 +484,7 @@
"family_languagesCheck: OK\n",
"bookkeeping_no_childrenCheck: OK\n",
"no_empty_filesCheck: OK\n",
"Wall time: 2.84 s\n"
"Wall time: 2.88 s\n"
]
},
{
Expand Down Expand Up @@ -520,7 +520,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 12.3 s\n"
"Wall time: 12.5 s\n"
]
},
{
Expand All @@ -547,7 +547,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 13.2 s\n"
"Wall time: 12.8 s\n"
]
},
{
Expand Down Expand Up @@ -608,7 +608,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"[INFO@treedb.logging] treedb version: 0.8.1\n",
"[INFO@treedb.logging] treedb version: 0.8.2\n",
"SELECT sqlite_version() AS sqlite_version_1\n",
"()\n"
]
Expand Down Expand Up @@ -899,7 +899,7 @@
"output_type": "stream",
"text": [
"None\n",
"67\n"
"68\n"
]
}
],
Expand Down Expand Up @@ -1146,7 +1146,7 @@
" </tr>\n",
" <tr>\n",
" <th>version</th>\n",
" <td>0.8.1</td>\n",
" <td>0.8.2</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -1156,7 +1156,7 @@
" __producer__\n",
"id True\n",
"name treedb\n",
"version 0.8.1"
"version 0.8.2"
]
},
"execution_count": 28,
Expand Down Expand Up @@ -1191,7 +1191,12 @@
"WHERE sqlite_master.type = ? AND sqlite_master.name = ?\n",
"('table', '_file')\n",
"SELECT count(*) AS n_files \n",
"FROM _file\n"
"FROM _file\n",
"()\n",
"SELECT sqlite_master.sql \n",
"FROM sqlite_master \n",
"WHERE sqlite_master.type = ? AND sqlite_master.name = ?\n",
"('table', '_option')\n"
]
},
{
Expand All @@ -1209,28 +1214,30 @@
"\tUNIQUE (glottocode), \n",
"\tUNIQUE (path), \n",
"\tUNIQUE (sha256)\n",
")\n"
")\n",
"24701\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"SELECT count(*) AS n_options \n",
"FROM _option\n",
"()\n",
"SELECT sqlite_master.sql \n",
"FROM sqlite_master \n",
"WHERE sqlite_master.type = ? AND sqlite_master.name = ?\n",
"('table', '_option')\n",
"SELECT count(*) AS n_options \n",
"FROM _option\n",
"('table', '_value')\n",
"SELECT count(*) AS n_values \n",
"FROM _value\n",
"()\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"24701\n",
"CREATE TABLE _option (\n",
"\tid INTEGER NOT NULL, \n",
"\tsection TEXT NOT NULL CHECK (section != ''), \n",
Expand All @@ -1240,26 +1247,7 @@
"\tUNIQUE (section, option), \n",
"\tCHECK (is_lines IN (0, 1))\n",
")\n",
"52\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"SELECT sqlite_master.sql \n",
"FROM sqlite_master \n",
"WHERE sqlite_master.type = ? AND sqlite_master.name = ?\n",
"('table', '_value')\n",
"SELECT count(*) AS n_values \n",
"FROM _value\n",
"()\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"52\n",
"CREATE TABLE _value (\n",
"\tfile_id INTEGER NOT NULL, \n",
"\toption_id INTEGER NOT NULL, \n",
Expand Down Expand Up @@ -4543,7 +4531,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 11.4 s\n"
"Wall time: 11.6 s\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='treedb',
version='0.8.2.dev0',
version='0.8.2',
author='Sebastian Bank',
author_email='sebastian.bank@uni-leipzig.de',
description='Glottolog languoid tree as SQLite database',
Expand Down
4 changes: 2 additions & 2 deletions treedb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
'print_query_sql', 'set_engine', 'print_schema',
'Dataset', 'Producer', 'Session',
'backup', 'dump_sql', 'export',
'print_table_sql', 'select_stats',
'print_table_sql', 'select_stats',
'load',
'LEVEL', 'Languoid',
'check',
Expand All @@ -64,7 +64,7 @@
'root', 'engine']

__title__ = 'treedb'
__version__ = '0.8.2.dev0'
__version__ = '0.8.2'
__author__ = 'Sebastian Bank <sebastian.bank@uni-leipzig.de>'
__license__ = 'MIT, see LICENSE.txt'
__copyright__ = 'Copyright (c) 2017-2020 Sebastian Bank'
Expand Down
4 changes: 3 additions & 1 deletion treedb/backend_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def load(filename=ENGINE, repo_root=None, *,
elif ds.exclude_raw != bool(exclude_raw):
rebuild = True
log.info('rebuild needed from exclude_raw mismatch')
else:
ds = None

if rebuild:
log.info('rebuild database')
Expand All @@ -85,7 +87,7 @@ def load(filename=ENGINE, repo_root=None, *,
log.exception('error running %s.views.create_all_views(clear=%r)',
__package__, exclude_views)

if not rebuild:
if ds is not None and not rebuild:
Dataset.log_dataset(dict(ds))
pdc = Producer.get_producer(bind=engine)
Producer.log_producer(dict(pdc))
Expand Down
1 change: 1 addition & 0 deletions treedb/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def hash_rows(rows, *, header=None, name=None, raw=False,
return result


@_views.register_view('example')
def get_query(*, ordered='id', separator=', ', bind=ENGINE):
"""Return example sqlalchemy core query (one denormalized row per languoid)."""
group_concat = lambda x: sa.func.group_concat(x, separator)
Expand Down

0 comments on commit a6ccd26

Please sign in to comment.