Skip to content

Conversation

@AlexHilson
Copy link
Collaborator

This is a first pass at adding support for the regional text forecast.

The idea is that this allows requesting the 'raw' text forecast - as you can see from the example this requires a bit of work on the user side to make usable. This leaves room for a more opinionated implementation to be added later.

@jacobtomlinson
Copy link
Collaborator

jacobtomlinson commented Jul 22, 2016

Test failures are due to the API key not being set. This is fine as it is a PR and Travis hides the key for security.

Can you set the API_KEY environment variable and run nosetests -w tests/integration locally to confirm it is working.

@jacobtomlinson
Copy link
Collaborator

jacobtomlinson commented Jul 22, 2016

Recreated error with the following steps

$ docker run --rm -ti -v $(pwd):/usr/src/app python:2 /bin/bash
# cd /usr/src/app/
# pip install -r requirements.txt
# pip install nose
# python setup.py install
# nosetests -w tests/integration

Getting the following error

EE
======================================================================
ERROR: Failure: ImportError (No module named regions.RegionManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/src/app/tests/integration/manager_test.py", line 6, in <module>
    import datapoint
  File "/usr/local/lib/python2.7/site-packages/datapoint/__init__.py", line 9, in <module>
    from .Manager import Manager
  File "/usr/local/lib/python2.7/site-packages/datapoint/Manager.py", line 18, in <module>
    from .regions.RegionManager import RegionManager
ImportError: No module named regions.RegionManager

======================================================================
ERROR: Failure: ImportError (No module named regions.RegionManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/src/app/tests/integration/regions_test.py", line 6, in <module>
    import datapoint
  File "/usr/local/lib/python2.7/site-packages/datapoint/__init__.py", line 9, in <module>
    from .Manager import Manager
  File "/usr/local/lib/python2.7/site-packages/datapoint/Manager.py", line 18, in <module>
    from .regions.RegionManager import RegionManager
ImportError: No module named regions.RegionManager

----------------------------------------------------------------------
Ran 2 tests in 0.086s

FAILED (errors=2)

@jacobtomlinson
Copy link
Collaborator

Can you write a quick usage example for this?

See the current examples for inspiration.


# Create datapoint connection
#aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
conn = datapoint.Manager(api_key="c4260d02-3133-488d-91bd-abf66150dbe9")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this key should be here?

@jacobtomlinson jacobtomlinson merged commit b85bfe3 into Perseudonymous:master Aug 1, 2016
@jacobtomlinson jacobtomlinson mentioned this pull request Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants