Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Release 3.0.0 #24

Merged
merged 52 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6536bc4
Removed enum package
thinkh Aug 19, 2019
824f86e
Update python requirements
thinkh Aug 19, 2019
9b578be
CircleCI Docker Image 'python:3.7-node-browsers'
dvvanessastoiber Aug 20, 2019
45bc67a
CircleCI Docker image 'python:3.7-node-browsers'
dvvanessastoiber Aug 20, 2019
2d9ab1a
Remove .encode('ascii') from setup.py
dvvanessastoiber Aug 20, 2019
ca719f6
Replace python tests py27 and py34 with py37
dvvanessastoiber Aug 20, 2019
325e36f
used lib2to3 to convert files to new syntax
dvvanessastoiber Aug 20, 2019
5ba520d
updated dependencies according to phovea_python
dvvanessastoiber Aug 20, 2019
9f1eab8
Use node v8.16.1 in circleci docker image
thinkh Aug 22, 2019
7f0d9fd
removed list() from lib2to3
dvvanessastoiber Aug 22, 2019
4eba7f6
adapted pandas import
dvvanessastoiber Aug 22, 2019
a8c913b
Merge branch 'python_3.7' of https://github.com/Caleydo/taco_server i…
dvvanessastoiber Aug 22, 2019
6288439
fixed indentation
dvvanessastoiber Aug 28, 2019
f49ba66
created JsonEncoder
dvvanessastoiber Sep 3, 2019
568a56a
remove pandas, use json and custom encoder instead
dvvanessastoiber Sep 3, 2019
c198a08
change dtype of numpy.ndarray to string
dvvanessastoiber Sep 5, 2019
c269808
removed IndexError
dvvanessastoiber Sep 5, 2019
83617a0
remove _travis.yml_
dvvanessastoiber Oct 14, 2019
83d4ca1
switch branches in _requirements.txt_
dvvanessastoiber Oct 14, 2019
8c27fad
update node environment variable
dvvanessastoiber Oct 14, 2019
dc06b45
switch branches in _requirements.txt_
dvvanessastoiber Oct 18, 2019
5fd73c5
unify _package.json_
dvvanessastoiber Oct 23, 2019
056c5a7
fix problems with JSON encoder
dvvanessastoiber Oct 28, 2019
981193d
use `destination` instead of invalid `prefix`
dvvanessastoiber Oct 30, 2019
dc56e50
update node version to "12.13"
dvvanessastoiber Oct 30, 2019
fbdb8aa
change type of numpy array to avoid error
dvvanessastoiber Oct 31, 2019
46f81ce
fix check whether key exists
dvvanessastoiber Oct 31, 2019
e81b779
Merge branch 'develop' into stoiber/17_KeyError_in_diff_finder
thinkh Oct 31, 2019
44e36ab
Merge branch 'develop' into stoiber/general_repo_changes
thinkh Oct 31, 2019
fd55b8e
Merge branch 'develop' into python_3.7
thinkh Oct 31, 2019
dd5af07
General repo changes (#16)
Oct 31, 2019
d9e28a7
Merge pull request #18 from Caleydo/stoiber/17_KeyError_in_diff_finder
Oct 31, 2019
8476ac4
Merge branch 'flask_1.1.1' into python_3.7
dvvanessastoiber Oct 31, 2019
1e812f9
switch branches in _requirements.txt_
dvvanessastoiber Oct 31, 2019
dab80fe
fix error with indentation and unused variables
dvvanessastoiber Oct 31, 2019
eff794d
add spaces
dvvanessastoiber Oct 31, 2019
9889a86
add decoding
dvvanessastoiber Oct 31, 2019
f02650d
Merge remote-tracking branch 'origin/develop' into python_3.7
dvvanessastoiber Dec 11, 2019
06f6f0c
Update template files and dependencies
thinkh Dec 18, 2019
1002ad5
Fix flake8
thinkh Dec 18, 2019
f82ae49
Fix flake8
thinkh Dec 18, 2019
c91574a
Update template files and dependencies (#22)
Dec 18, 2019
2db80c8
change type of array in `Table` to string
dvvanessastoiber Dec 19, 2019
f081ed5
use custom JsonEncoder
dvvanessastoiber Dec 19, 2019
4a377ca
Merge branch 'develop' into python_3.7
thinkh Jan 2, 2020
5dd80ec
Use Debian `buster` as CircleCI Docker image
thinkh Jan 2, 2020
041a240
Remove .gitlab-ci.yml
thinkh Jan 2, 2020
005df32
Migrate to Python 3.7 (#21)
Jan 2, 2020
c94221e
Ignore package-lock.json
rumersdorfer Jan 7, 2020
6d1ac79
Merge pull request #23 from Caleydo/rumersdorfer-patch-1
Jan 9, 2020
e0308e8
Prepare release 3.0.0
dvvanessastoiber Jan 16, 2020
25b9572
Update package.json
Jan 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@ jobs:
build:
working_directory: ~/phovea
docker:
- image: caleydo/phovea_circleci_python:v2.0
- image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
steps:
- checkout
- run:
name: Show Node.js and npm version
command: |
node -v
npm -v
- run:
name: Show Python and pip version
command: |
python --version
pip --version
- run:
name: Install Docker packages from docker_packages.txt
command: |
(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
- run:
name: install-pip-wee
name: Install pip requirements
command: |
virtualenv ~/venv
. ~/venv/bin/activate
Expand All @@ -22,25 +33,28 @@ jobs:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
paths:
- ~/venv
- run: #force update of VCS dependencies?
name: update-pip-vcs-dependencies
- run:
name: Force an update of pip dependencies from git repositories # not sure if this is working ?
command: |
. ~/venv/bin/activate
pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
- run:
name: dist
name: Show installed pip packages
command: pip list || true
- run:
name: Build
command: |
. ~/venv/bin/activate
npm run dist
- store_artifacts:
path: dist
prefix: dist
destination: dist
workflows:
version: 2
# build-nightly:
# triggers:
# - schedule: # nightly build during weekday
# cron: "15 1 * * 1-5"
# - schedule:
# cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5
# filters:
# branches:
# only:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ __pycache__/
# due to using tox and pytest
.tox
.cache
package-lock.json
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"debianPackages": [],
"redhatPackages": []
},
"today": "Tue, 08 Nov 2016 08:36:05 GMT"
"today": "Tue, 08 Nov 2016 08:36:05 GMT",
"promptValues": {
"authorName": "The Caleydo Team",
"authorEmail": "contact@caleydo.org",
"authorUrl": "https://caleydo.org",
"githubAccount": "caleydo"
}
}
}
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _resolve_plugin(repo, version):
if os.path.isdir('.git') and repo:
if repo.endswith('.git'):
repo = repo[0:-4]
return repo + '/commit/' + _git_head('.')
return repo + '/commit/' + _git_head('.').decode('utf-8')
# not a git repo
return version

Expand Down
69 changes: 69 additions & 0 deletions buildPython.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Created by sam on 13.11.2016.
*/

const spawnSync = require('child_process').spawnSync;
const fs = require('fs');

function gitHead(cwd) {
const r = spawnSync('git', ['rev-parse', '--verify', 'HEAD'], {
cwd: cwd
});
if (!r.stdout) {
console.error(cwd, r.error);
return 'error';
}
return r.stdout.toString().trim();
}

function resolvePlugin(repo, version) {
if (fs.lstatSync('.git').isDirectory() && repo) {
if (repo.endsWith('.git')) {
repo = repo.slice(0, repo.length - 4);
return repo + '/commit/' + gitHead('.');
}
}
// not a git repo
return version;
}

function toVersion(v) {
const now = new Date().toISOString();
// %Y%m%d-%H%M%S
const fmt = now
.replace(/T/, ' ')
.replace(/\..+/, '')
.replace(/[-:]/, '')
.replace(' ', '-');
return v.replace('SNAPSHOT', fmt);
}

function _main() {
const pkg = require('./package.json');
const name = pkg.name;
const version = toVersion(pkg.version);
const resolved = resolvePlugin((pkg.repository || {}).url, version);

const buildInfo = {
name,
version,
resolved,
description: pkg.description,
homepage: pkg.homepage,
repository: (pkg.repository || {}).url
};

const l = ('build/source/' + name.toLowerCase()).split('/');
l.forEach((_, i) => {
const path = l.slice(0, i + 1).join('/');
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
});

fs.writeFileSync('build/source/' + name.toLowerCase() + '/buildInfo.json', JSON.stringify(buildInfo, null, ' '));
}

if (require.main === module) {
_main();
}
81 changes: 42 additions & 39 deletions data/olympics_generator/count_by_year.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
import csv
import json

createdCSVs = []
created_cvs_list = []

def writeIndexJson():

def write_index_json():
with open('../index.json', 'w') as outfile:
json.dump(createdCSVs, outfile)
json.dump(created_cvs_list, outfile)


def writeCSV(year, medalType, fieldnames, medalsPerCountry):
def write_csv(year, medal_type, fieldnames, medals_per_country):
if year is None:
print('Invalid year -> file not written')
return

name = 'Olympic Games ' + year + ' (' + medalType + ' Medals)'
filename = 'olympics_' + year + '_' + medalType.lower() + '.csv'
name = 'Olympic Games ' + year + ' (' + medal_type + ' Medals)'
filename = 'olympics_' + year + '_' + medal_type.lower() + '.csv'

# sort countries by sum of all medals
sortedBySum = sorted(medalsPerCountry.items(), key=lambda x: sum(x[1].values()), reverse=True)
sorted_by_sum = sorted(medals_per_country.items(), key=lambda x: sum(x[1].values()), reverse=True)

print('----------------')
print('Write ' + filename)
print(fieldnames)
print(sortedBySum)
print(sorted_by_sum)

# get min and max value of the whole csv for the range
maxValue = float('-inf')
#minValue = float('inf') # does not work, because we fill empty cells with 0 by default
max_value = float('-inf')
# min_value = float('inf') # does not work, because we fill empty cells with 0 by default

with open('../' + filename, 'wb') as output:
writer = csv.DictWriter(output, fieldnames=fieldnames, restval='0', dialect='excel')
writer.writeheader()
for k, v in sortedBySum:
for k, v in sorted_by_sum:
values = list(v.values())
maxValue = max(maxValue, max(values))
#minValue = min(minValue, min(values))
max_value = max(max_value, max(values))
# min_value = min(min_value, min(values))
v['CountryCode'] = k
writer.writerow(v)

Expand All @@ -43,57 +44,59 @@ def writeCSV(year, medalType, fieldnames, medalsPerCountry):
stats['name'] = name
stats['path'] = filename
stats['type'] = 'matrix'
stats['size'] = [len(sortedBySum), len(fieldnames)-1] # -1 = CountryCode fieldname
stats['size'] = [len(sorted_by_sum), len(fieldnames)-1] # -1 = CountryCode fieldname
stats['rowtype'] = 'Country'
stats['coltype'] = 'Discipline'
stats['value'] = dict(type='real', range=[0, maxValue])
stats['value'] = dict(type='real', range=[0, max_value])

createdCSVs.append(stats)
created_cvs_list.append(stats)

print('----------------')

def readCSV(medalType = 'Total'):

def read_csv(medal_type='Total'):
with open('./MedalData1.csv', 'rb') as csvfile:
reader = csv.DictReader(csvfile, fieldnames=['Games','Sport','Event','Athlete(s)','CountryCode','CountryName','Medal','ResultInSeconds'], dialect='excel-tab')
reader = csv.DictReader(csvfile, fieldnames=['Games', 'Sport', 'Event', 'Athlete(s)', 'CountryCode', 'CountryName', 'Medal', 'ResultInSeconds'], dialect='excel-tab')
next(reader)

lastGames = None
last_games = None
fieldnames = ['CountryCode']
medalsPerCountry = dict()
medals_per_country = dict()

for row in reader:
if row['Games'] != lastGames:
if row['Games'] != last_games:
# write old year when a new year is detected
writeCSV(lastGames, medalType, fieldnames, medalsPerCountry)
write_csv(last_games, medal_type, fieldnames, medals_per_country)

# clean up variables
fieldnames = ['CountryCode']
medalsPerCountry = dict()
medals_per_country = dict()

lastGames = row['Games']
country = row['CountryCode'] # short-cut
last_games = row['Games']
country = row['CountryCode'] # short-cut

if row['Event'] not in fieldnames:
fieldnames.append(row['Event'])

if row['Medal'] == medalType or medalType is 'Total':
if country not in medalsPerCountry:
medalsPerCountry[country] = dict()
#medalsPerCountry[country]['CountryCode'] = country
if row['Medal'] == medal_type or medal_type == 'Total':
if country not in medals_per_country:
medals_per_country[country] = dict()
# medals_per_country[country]['CountryCode'] = country

if row['Event'] not in medalsPerCountry[country]:
medalsPerCountry[country][row['Event']] = 0
if row['Event'] not in medals_per_country[country]:
medals_per_country[country][row['Event']] = 0

medalsPerCountry[country][row['Event']] += 1
medals_per_country[country][row['Event']] += 1

#print(row['Games'], row['Event'], country, row['Medal'])
# print(row['Games'], row['Event'], country, row['Medal'])

# write the last file
writeCSV(lastGames, medalType, fieldnames, medalsPerCountry)
write_csv(last_games, medal_type, fieldnames, medals_per_country)


readCSV('Total')
readCSV('Bronze')
readCSV('Silver')
readCSV('Gold')
read_csv('Total')
read_csv('Bronze')
read_csv('Silver')
read_csv('Gold')

writeIndexJson()
write_index_json()
1 change: 1 addition & 0 deletions deploy/docker-compose.partial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: '2.0'
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"name": "taco_server",
"description": "The server part for comparing large tabular data using Phovea",
"version": "3.0.0",
"author": {
"name": "The Caleydo Team",
"email": "contact@caleydo.org",
"url": "https://caleydo.org"
},
"license": "BSD-3-Clause",
"homepage": "http://caleydo.org",
"bugs": {
"url": "https://github.com/caleydo/taco_server/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Caleydo/taco_server.git"
},
"files": [
"taco_server",
"__init__.py",
Expand All @@ -9,30 +26,13 @@
"docker_packages.txt"
],
"scripts": {
"check": "flake8",
"check": "flake8 --exclude=.git,venv,deploy,docs,__pycache__,node_modules",
"pretest": "npm run check",
"test": "test ! -d tests || python setup.py test",
"prebuild": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test",
"build": "python build.py",
"build": "rm -rf build/source && find . -name '*.pyc' -delete && node buildPython.js && cp -r ./taco_server build/source/",
"predist": "npm run build && npm run docs",
"dist": "python setup.py bdist_egg && cd build && tar cvzf ../dist/taco_server.tar.gz *",
"dist": "python setup.py sdist bdist_wheel",
"docs": "sphinx-apidoc -o docs -f ./taco_server && sphinx-build ./docs build/docs"
},
"name": "taco_server",
"description": "The server part for comparing large tabular data using Phovea",
"homepage": "http://caleydo.org",
"version": "1.0.0-SNAPSHOT",
"author": {
"name": "The Caleydo Team",
"email": "contact@caleydo.org",
"url": "https://caleydo.org"
},
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/caleydo/taco_server/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/caleydo/taco_server.git"
}
}
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-e git+https://github.com/phovea/phovea_server.git@develop#egg=phovea_server
enum==0.4.6
phovea_server>=4.0.0,<5.0.0
sklearn==0.0
Loading