Skip to content

Commit

Permalink
v1.0.a1
Browse files Browse the repository at this point in the history
  • Loading branch information
xrotwang committed Jul 17, 2018
1 parent 9ef6a76 commit d039013
Show file tree
Hide file tree
Showing 26 changed files with 5,588 additions and 1,501 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,6 +1,5 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -146,7 +146,7 @@ Colexification analyses are named by three components as `g-t-f.gml`, with g poi
The communities in the paper have been calculated with the following parameters:

```shell
$ clics -t 3 -f families -n communities
$ clics -t 3 -f families communities
```


Expand Down
1,186 changes: 0 additions & 1,186 deletions datasets/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions datasets/datasets.csv

This file was deleted.

195 changes: 0 additions & 195 deletions datasets/sources.bib

This file was deleted.

5 changes: 2 additions & 3 deletions setup.py
Expand Up @@ -3,7 +3,7 @@

setup(
name='pyclics',
version='0.1',
version='1.0',
author='Johann-Mattis List and Robert Forkel',
url='https://github.com/clics/clics2',
classifiers=[
Expand All @@ -18,12 +18,11 @@
packages=find_packages(where='src'),
package_dir={'': 'src'},
install_requires=[
'lingpy',
'pycldf~=1.0',
'pylexibank>=0.7',
'clldutils~=2.0',
'geojson',
'python-igraph',
'networkx',
'unidecode'
],
extras_require={
Expand Down
8 changes: 5 additions & 3 deletions src/pyclics/__main__.py
@@ -1,8 +1,9 @@
# coding: utf8
from __future__ import unicode_literals, print_function, division
import sys
import argparse
import random

import numpy
from clldutils.clilib import ArgumentParserWithLogging
from clldutils.path import Path

Expand All @@ -12,16 +13,17 @@

assert pyclics.commands

random.seed(123456)
numpy.random.seed(123456)


def main(): # pragma: no cover
parser = ArgumentParserWithLogging(pyclics.__name__)
parser.add_argument('-t', '--threshold', type=int, default=None)
parser.add_argument('-f', '--edgefilter', default='families')
parser.add_argument('-n', '--normalize', action='store_true')
parser.add_argument('-g', '--graphname', default=None)
parser.add_argument('-s', '--subgraph', default='infomap')
parser.add_argument('-w', '--weight', default='FamilyWeight')
parser.add_argument('-a', '--aspect', default=None)
parser.add_argument('--unloaded', action='store_true', default=False)
parser.add_argument('-v', '--verbose', default=False, action='store_true')
parser.add_argument(
Expand Down
9 changes: 6 additions & 3 deletions src/pyclics/api.py
@@ -1,5 +1,4 @@
# coding: utf8
from __future__ import unicode_literals, print_function, division
import json

from clldutils.apilib import API
Expand All @@ -11,6 +10,8 @@
from pyclics.db import Database
from pyclics.models import Network

__all__ = ['Clics']


class Clics(API):
_log = None
Expand All @@ -32,6 +33,7 @@ def db(self):
def file_written(self, p):
if self._log:
self._log.info('{0} written'.format(p))
return p

def csv_writer(self, comp, name, delimiter=',', suffix='csv'):
p = self.existing_dir(comp).joinpath('{0}.{1}'.format(name, suffix))
Expand All @@ -51,8 +53,9 @@ def write_js_var(self, var_name, var, *path):
def save_graph(self, graph, network, threshold=None, edgefilter=None):
if not isinstance(network, Network):
assert threshold is not None and edgefilter is not None
network = Network(network, threshold, edgefilter)
self.file_written(network.save(graph))
network = Network(
network, threshold, edgefilter, graphdir=self.path('output', 'graphs'))
return self.file_written(network.save(graph))

def load_graph(self, network, threshold=None, edgefilter=None):
if not isinstance(network, Network):
Expand Down

0 comments on commit d039013

Please sign in to comment.