Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces datasethelpers with pkg_resources. #1902

Merged
merged 7 commits into from
Mar 5, 2015

Conversation

rhyolight
Copy link
Member

Fixes #1899

  • Added example data location to setup.py as package data.
  • Added example/prediction/data files to MANIFEST.
  • Updated tests to use pkg_resources to fetch data files.
  • Updated example code to fetch data through pkg_resources.
  • Used pkg_resources to load files in nupic.data code.
  • Removing datasethelpers and tests.
  • Updated tests to write data files into examples/prediction/data.
  • Updated experiment runner to resolve paths better.
    • The experiment stream source could be an absolute path or a
      path relative to the "examples.prediction.data" pkg_resource. Updated its logic to identify absolute paths and convert relative paths through pkg_resources.
    • Updated swarming test configuration.
      • A bunch of the swarming test configurations were expecting datasethelpers to find the input file on a search path that doesn't exist anymore. I solved this by:
        • moving test_data.csv from tests/swarming/nupic/swarming/data into the package_data directory in the "swarming" folder
        • adding init.py to the swarming folder mentioned above
        • updating ModelRunner to call normalizeStreamSources(), which now does the pkg_resoruces lookup
        • updating all the description files to refer to "swarming/test_data.csv"

- Added example data location to setup.py as package data.
- Added example/prediction/data files to MANIFEST.
- Updated tests to use pkg_resources to fetch data files.
- Updated example code to fetch data through pkg_resources.
- Used pkg_resources to load files in nupic.data code.
- Removing datasethelpers and tests.
- Updated tests to write data files into examples/prediction/data.
- Updated experiment runner to resolve paths better.
    - The experiment stream source could be an absolute path or a
      path relative to the "examples.prediction.data" pkg_resource.  Updated its logic to identify absolute paths and convert relative paths through pkg_resources.
    - Updated swarming test configuration.
        - A bunch of the swarming test configurations were expecting datasethelpers to find the input file on a search path that doesn't exist anymore. I solved this by:
            - moving test_data.csv from tests/swarming/nupic/swarming/data into the package_data directory in the "swarming" folder
            - adding __init__.py to the swarming folder mentioned above
            - updating ModelRunner to call normalizeStreamSources(), which now does the pkg_resoruces lookup
            - updating all the description files to refer to "swarming/test_data.csv"
@rhyolight rhyolight closed this Mar 4, 2015
@rhyolight rhyolight reopened this Mar 4, 2015
@rhyolight
Copy link
Member Author

@scottpurdy Sorry, the --force push worked, but GitHub wouldn't let me re-open the PR.

@rhyolight
Copy link
Member Author

🍏 😄 Finally.

@david-ragazzi
Copy link
Contributor

👍 Looks fine.

Thanks for replace support code that is natively provided by python eco-system, @rhyolight !

@@ -10,3 +10,5 @@ recursive-include extensions *.hpp *.cpp
recursive-include external/common/share/swig *.*
recursive-include external/darwin64 swig *.a
recursive-include external/linux64 swig *.a

recursive-include examples/prediction/data *.csv *.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: newline

@rhyolight
Copy link
Member Author

Ok, I'm working on it...

tumblr_m3scxjh7uy1qd7m1so1_500

@cogmission
Copy link
Contributor

lol!!!

Also cleaned up unecessary __init__.py files. Found a few places where
test code was explicitly looking for data in "examples/prediction/data"
and updated them to also use pkg_resources.
@rhyolight
Copy link
Member Author

@scottpurdy Ready for your re-review.

@rhyolight
Copy link
Member Author

Unexpected build error in Travis:

error: can't copy 'nupic/bindings/algorithms_wrap.cxx': doesn't exist or not a regular file

I usually see this when I haven't cleaned up leftover files from builds on other branches, so this doesn't make sense to me. It is not happening on my local build.

@rhyolight
Copy link
Member Author

Hoping that getting the new nupic.core will help...

@rhyolight
Copy link
Member Author

This same error is suddenly happening on the master branch builds, too! 😨

@breznak
Copy link
Member

breznak commented Mar 4, 2015

@rhyolight u sure about the broken master? My local build is just fine, and so seems #1907 PR

@rhyolight
Copy link
Member Author

@breznak Yeah it's broken for me locally, too... I'm looking into it.

@scottpurdy
Copy link
Contributor

👍

@rhyolight
Copy link
Member Author

Waiting for #1909 then I'll merge it in.

rhyolight added a commit that referenced this pull request Mar 5, 2015
Replaces datasethelpers with pkg_resources.
@rhyolight rhyolight merged commit 0ca63b1 into numenta:master Mar 5, 2015
@rhyolight rhyolight deleted the standard-example-data3 branch March 5, 2015 04:04
chrox added a commit to chrox/nupic that referenced this pull request Apr 25, 2015
rhyolight added a commit that referenced this pull request May 20, 2015
Reflect using pkg_resources to locate resource files as implemented in #1902.
mihail911 pushed a commit to mihail911/nupic that referenced this pull request Aug 5, 2015
Replaces datasethelpers with pkg_resources.
mihail911 pushed a commit to mihail911/nupic that referenced this pull request Aug 5, 2015
mihail911 pushed a commit to mihail911/nupic that referenced this pull request Aug 5, 2015
Reflect using pkg_resources to locate resource files as implemented in numenta#1902.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize data file retrieval within all example code
5 participants