Skip to content

Commit b5a5963

Browse files
authored
Implemented DCNode constructor and get_property_values (#51)
* Added cloud build files * Implemented DCNode constructor and get_property_values * Added additional error to constructor * Remove limit adjustment * Fixed a bug in eq
1 parent 7de103e commit b5a5963

File tree

11 files changed

+729
-598
lines changed

11 files changed

+729
-598
lines changed

.gitignore

Lines changed: 103 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,116 @@
11
__pycache__/
2+
.dat
3+
4+
### Python ###
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
27
*.py[cod]
38
*$py.class
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
pip-wheel-metadata/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# Unit test / coverage reports
32+
htmlcov/
33+
.tox/
34+
.nox/
35+
.coverage
36+
.coverage.*
37+
.cache
38+
nosetests.xml
39+
coverage.xml
40+
*.cover
41+
.hypothesis/
42+
.pytest_cache/
43+
44+
# Translations
45+
*.mo
46+
*.pot
47+
48+
# Django stuff:
49+
*.log
50+
local_settings.py
51+
db.sqlite3
52+
db.sqlite3-journal
53+
54+
# Flask stuff:
55+
instance/
56+
.webassets-cache
57+
58+
# Scrapy stuff:
59+
.scrapy
60+
61+
# Sphinx documentation
62+
docs/_build/
63+
64+
# PyBuilder
65+
target/
66+
67+
# Jupyter Notebook
68+
.ipynb_checkpoints
69+
70+
# IPython
71+
profile_default/
72+
ipython_config.py
73+
74+
# pyenv
475
.python-version
76+
77+
# Environments
578
.env
679
.venv
780
env/
881
venv/
982
ENV/
1083
env.bak/
1184
venv.bak/
12-
.pyc
13-
.profraw
14-
.dat
85+
86+
### Ignore MAC OS System files ###
87+
# General
1588
.DS_Store
89+
.AppleDouble
90+
.LSOverride
91+
.profraw
92+
93+
# Icon must end with two \r
94+
Icon
95+
96+
# Thumbnails
1697
._*
98+
99+
# Files that might appear in the root of a volume
100+
.DocumentRevisions-V100
101+
.fseventsd
102+
.Spotlight-V100
103+
.TemporaryItems
104+
.Trashes
105+
.VolumeIcon.icns
106+
.com.apple.timemachine.donotpresent
107+
108+
# Directories potentially created on remote AFP share
109+
.AppleDB
110+
.AppleDesktop
111+
Network Trash Folder
112+
Temporary Items
113+
.apdisk
114+
115+
### Ignore BAZEL BUILD System files ###
116+
/bazel-*

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3
2+
3+
WORKDIR /datacommons
4+
5+
COPY . /datacommons
6+
7+
# Install Bazel build tool
8+
RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
9+
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
10+
11+
# Install required packages
12+
RUN apt-get -q update && \
13+
apt-get -q -y install --no-install-recommends \
14+
bazel \
15+
time
16+
17+
# Install python
18+
RUN python setup.py -q install
19+
20+
# Run the tests
21+
RUN ./build.sh

WORKSPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
workspace(name="datacommons")
2+
23
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
34

45
# The following rules are needed to perform pip-install of dependencies.

build.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2017 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# This script runs all unit tests for the Data Commons python client.
16+
#
17+
18+
echo "\n--------------------------------------------------------------------------------\nSYSTEM INFORMATION\n--------------------------------------------------------------------------------\n"
19+
20+
echo "Python binary: $(which python)" && python --version
21+
echo "Bazel binary: $(which bazel)" && bazel version
22+
23+
echo "\n--------------------------------------------------------------------------------\nBUILDING DATA COMMONS\n--------------------------------------------------------------------------------\n"
24+
25+
# Build the code
26+
time bazel build --incompatible_disable_deprecated_attr_params=false //... || exit 1
27+
28+
echo "\n--------------------------------------------------------------------------------\nTESTING DATA COMMONS\n--------------------------------------------------------------------------------\n"
29+
30+
# Change to repo root
31+
cd datacommons
32+
33+
# Fail on any error.
34+
set -e
35+
36+
# Test the code
37+
time bazel test --test_output=errors --incompatible_disable_deprecated_attr_params=false //... || exit 1

datacommons/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@
1313
# limitations under the License.
1414
"""Data Commons module."""
1515

16-
from .bio import BioExtension, DEFAULT_BEDLINE_PROPS
17-
from .datacommons import Client, DCNode, DCFrame
18-
from .places import PlacesExtension
19-
from .utils import DatalogQuery, MeasuredValue
16+
from .datacommons import DCNode

0 commit comments

Comments
 (0)