Skip to content

Commit 70aebfb

Browse files
committed
Merge branch 'fix-65'
2 parents 6599fa5 + efb05b9 commit 70aebfb

28 files changed

+113
-604
lines changed

.env.enc

432 Bytes
Binary file not shown.

.pylintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# lint Python modules using external checkers.
2+
[MASTER]
3+
ignore=SVN
4+
disable=R0903,R0912,R0913,R0914,R0915,W0141,C0111,C0103,W0603,W0703,R0911,C0301,C0302,R0902,R0904,W0142,W0212,E1101,E1103,R0201,W0201,W0122,W0232,RP0001,RP0003,RP0101,RP0002,RP0401,RP0701,RP0801,F0401,E0611,R0801,I0011
5+
disable=F0401,E0611,E1004,C0111,I0011,I0012,W0704,W0142,W0212,W0232,W0613,W0702,R0201,W0614,R0914,R0912,R0915,R0913,R0904,R0801,C0301,C0411,R0204

.travis.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,22 @@ sudo: false
33
notifications:
44
email: false
55
python:
6-
- '2.6'
76
- '2.7'
87
- '3.2'
98
- '3.3'
109
- '3.4'
1110
- '3.5'
1211
- 3.5-dev
1312
before_install:
14-
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_c3e85137836d_key
15-
-iv $encrypted_c3e85137836d_iv -in .env.enc -out .env -d || true'
13+
- ! '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_6e98b3e8e789_key -iv $encrypted_6e98b3e8e789_iv -in .env.enc -out .env -d || true'
1614
install:
1715
- pip install -r requirements-dev.txt
1816
- pip install pylint
1917
- pip install codecov
2018
- pip install git+git://github.com/watson-developer-cloud/python-sdk.git#egg=watson-developer-cloud
21-
2219
script:
23-
- sh pylint.sh
24-
- py.test test --cov=watson_developer_cloud
20+
- sh pylint.sh
21+
- py.test test --cov=watson_developer_cloud
2522
after_success:
26-
- codecov
27-
- docs/publish.sh
28-
23+
- codecov
24+
- docs/publish.sh

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ To get your service credentials, follow these steps:
4040
Tested 👌 (lightly) on: Python from 2.7 to 3.5-dev (development branch).
4141
Python 2.6 is partially supported but generates InsecurePlatformWarnings (and other warnings), which can be ignored.
4242

43+
## CHANGELOG
44+
See [CHANGELOG][CHANGELOG.md].
45+
4346
## Known Issues
4447
There is a known incompatibility with this module with Python versions 3.x with Korean systems.
4548

@@ -62,4 +65,6 @@ This library is licensed under the [Apache 2.0 license][license].
6265
[requests]: http://docs.python-requests.org/en/latest/
6366
[examples]: https://github.com/watson-developer-cloud/python-sdk/tree/master/examples
6467
[CONTRIBUTING]: https://github.com/watson-developer-cloud/python-sdk/blob/master/CONTRIBUTING.md
68+
[CHANGELOG.md]: https://github.com/watson-developer-cloud/python-sdk/blob/master/CHANGELOG.md
69+
6570
[license]: http://www.apache.org/licenses/LICENSE-2.0

examples/concept_expansion_v1.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/concept_insights_v2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
corpora = concept_insights.list_corpora()
3333
print (json.dumps(corpora, indent=2))
3434

35+
corpora = concept_insights.list_corpora(account='public')
36+
print (json.dumps(corpora, indent=2))
37+
38+
3539
corpus = concept_insights.get_corpus('ibmresearcher', account='public')
3640
print(json.dumps(corpus, indent=2))
3741

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import json
2+
from watson_developer_cloud import ConversationV1Experimental
3+
4+
5+
conversation = ConversationV1Experimental(
6+
username='YOUR SERVICE USERNAME',
7+
password='YOUR SERVICE PASSWORD',
8+
version='2016-05-09')
9+
10+
# replace with your own workspace_id
11+
workspace_id = '25dfa8a0-0263-471b-8980-317e68c30488'
12+
13+
response = conversation.message(workspace_id=workspace_id, message_input={'text': 'What\'s the weather like?'})
14+
print(json.dumps(response, indent=2))

examples/natural_language_classifier_v1.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
# with open('../resources/weather_data_train.csv', 'rb') as training_data:
1515
# print(json.dumps(natural_language_classifier.create(training_data=training_data, name='weather'), indent=2))
1616

17-
# replace 4f1704ex55-nlc-2432" with your classifier id
18-
status = natural_language_classifier.status('3a84d1x62-nlc-18096')
17+
# replace 2374f9x68-nlc-2697 with your classifier id
18+
status = natural_language_classifier.status('2374f9x68-nlc-2697')
1919
print(json.dumps(status, indent=2))
20-
#
21-
classes = natural_language_classifier.classify('3a84d1x62-nlc-18096', 'How hot will it be tomorrow?')
22-
print(json.dumps(classes, indent=2))
20+
21+
if status['status'] == 'Available':
22+
classes = natural_language_classifier.classify('2374f9x68-nlc-2697', 'How hot will it be tomorrow?')
23+
print(json.dumps(classes, indent=2))
24+
25+
# delete = natural_language_classifier.remove('2374f9x68-nlc-2697')
26+
# print(json.dumps(delete, indent=2))
2327

2428
# example of raising a WatsonException
2529
# print(json.dumps(natural_language_classifier.create(training_data='', name='weather3'), indent=2))

examples/retrieve_and_rank_v1.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# print(json.dumps(created_cluster, indent=2))
1616

1717
# Replace with your own solr_cluster_id
18-
solr_cluster_id = 'sc31a30e84_9094_4af2_93af_a8751257d4cc'
18+
solr_cluster_id = 'sc1ca661d0_0c8d_430d_8132_51ac6df940e1'
1919

2020
status = retrieve_and_rank.get_solr_cluster_status(solr_cluster_id=solr_cluster_id)
2121
print(json.dumps(status, indent=2))
@@ -34,12 +34,13 @@
3434
# collection = retrieve_and_rank.create_collection(solr_cluster_id, 'test-collection', 'test-config')
3535
# print(json.dumps(collection, indent=2))
3636

37-
collections = retrieve_and_rank.list_collections(solr_cluster_id=solr_cluster_id)
38-
print(json.dumps(collections, indent=2))
37+
if (len(configs['solr_configs']) > 0):
38+
collections = retrieve_and_rank.list_collections(solr_cluster_id=solr_cluster_id)
39+
print(json.dumps(collections, indent=2))
3940

40-
pysolr_client = retrieve_and_rank.get_pysolr_client(solr_cluster_id, 'test-collection')
41-
results = pysolr_client.search('bananas')
42-
print(results.docs)
41+
pysolr_client = retrieve_and_rank.get_pysolr_client(solr_cluster_id, 'test-collection')
42+
results = pysolr_client.search('bananas')
43+
print(results)
4344

4445
# Rankers
4546

examples/visual_insights_v1_experimental.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)