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

S3 drivers #44

Merged
merged 9 commits into from
Apr 13, 2018
Merged

S3 drivers #44

merged 9 commits into from
Apr 13, 2018

Conversation

mgasvoda
Copy link
Contributor

No description provided.

Copy link
Member

@jnelson16 jnelson16 left a comment

Choose a reason for hiding this comment

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

Test passes on my laptop, so this is probably good to go. I still want to try running one of the state corpora through the new driver, I'll let you know how that goes.

""" Filter paths based on index values. """
raise NotImplementedError

def gen_indces_and_paths(self):
Copy link
Member

Choose a reason for hiding this comment

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

spelling

@@ -5,5 +5,7 @@
FlatFileCorpusDriver,
RecursiveDirectoryCorpusDriver,
NamePatternCorpusDriver,
IndexDriver
IndexDriver,
Copy link
Member

Choose a reason for hiding this comment

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

@OliverSherouse Is there a reason this is not called IndexCorpusDriver, to follow the pattern above?

Copy link
Member

Choose a reason for hiding this comment

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

Nope. Let's add that as a bug and rename for 1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added as #46

rows.append((letter, number, path))
index_path = directory.join('index.csv')
with index_path.open('w', encoding='utf-8') as outf:
outf.write(u'letter,number,path\n')
Copy link
Member

Choose a reason for hiding this comment

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

Should we be using the csv.writerows method for this? Or is this a more efficient way for testing purposes? @OliverSherouse

Copy link
Member

Choose a reason for hiding this comment

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

Not more efficient, particularly, though not really a problem, either.

@jnelson16
Copy link
Member

I have an S3Driver working with the Wyoming (or as @OliverSherouse calls it, Wisconsin) corpus!

@mgasvoda mgasvoda mentioned this pull request Apr 13, 2018
Copy link
Member

@OliverSherouse OliverSherouse left a comment

Choose a reason for hiding this comment

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

Fix small bugs and a few questions.

rows.append((letter, number, path))
index_path = directory.join('index.csv')
with index_path.open('w', encoding='utf-8') as outf:
outf.write(u'letter,number,path\n')
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have u strings? This ain't 2007, we're not writing python 2!

outf.write(u'letter,number,path\n')
outf.write(u'\n'.join(','.join(row) for row in rows))
return quantgov.corpora.S3Driver(str(index_path),
bucket='quantgov-databanks')
Copy link
Member

Choose a reason for hiding this comment

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

Will people outside the core dev team be able to run these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As long as they have aws credentials for boto I believe so, since the bucket is public.

@OliverSherouse OliverSherouse merged commit ebcb7d2 into dev Apr 13, 2018
@OliverSherouse OliverSherouse deleted the s3_drivers branch April 13, 2018 17:33
OliverSherouse added a commit that referenced this pull request Apr 17, 2018
* Inaugurated 0.4.0 dev series

* Sentiment analysis (#33)

Closes #11 #12  #13 and adds Sentiment analysis!

* complexity

* complexity builtins

* complexity builtins with tests

* code review updates

* option tests

* added nltk requirement

in setup.py

* add pip install to .travis.yml

* nltk fixes

* another nltk fix

* last nltk fix?

* you know the drill

* Update .travis.yml

* nltk troubles

* some final cleanup

* if it aint broke...

* textblob sentiment

* tests and error raising

* fixed install req

* pep8 fixes

* code review updates

* fix travis file

* import fixes

* small fix

* Test corpora (#35)

* complexity

* complexity builtins

* complexity builtins with tests

* code review updates

* option tests

* added nltk requirement

in setup.py

* add pip install to .travis.yml

* nltk fixes

* another nltk fix

* last nltk fix?

* you know the drill

* Update .travis.yml

* nltk troubles

* some final cleanup

* new corpora

in English!!

* hotfix to add timestamp as corpus identifier

* Skl compatibility (#41)

* Add sklearn 0.17 compatibility

Paper over library reorganization.

* renamed corpora to corpus, added deprecation warning (#42)

* renamed corpora to corpus, added deprecation warning
* moved load_driver and set up for future forcing of full imports of submodules

Closes #31

* S3 drivers (#44)

* initial working commit for s3 driver and database driver

* removing 3.6 formatting

* adding extra requirements list

* adding basic s3 driver test

* Removing unnecessary function

* This ain't 2007

* test updates

* adding s3driver to new corpus structure

* Rounding (#45)

* bumped version
OliverSherouse added a commit that referenced this pull request Apr 17, 2018
* Inaugurated 0.4.0 dev series

* Sentiment analysis (#33)

Closes #11 #12  #13 and adds Sentiment analysis!

* complexity

* complexity builtins

* complexity builtins with tests

* code review updates

* option tests

* added nltk requirement

in setup.py

* add pip install to .travis.yml

* nltk fixes

* another nltk fix

* last nltk fix?

* you know the drill

* Update .travis.yml

* nltk troubles

* some final cleanup

* if it aint broke...

* textblob sentiment

* tests and error raising

* fixed install req

* pep8 fixes

* code review updates

* fix travis file

* import fixes

* small fix

* Test corpora (#35)

* complexity

* complexity builtins

* complexity builtins with tests

* code review updates

* option tests

* added nltk requirement

in setup.py

* add pip install to .travis.yml

* nltk fixes

* another nltk fix

* last nltk fix?

* you know the drill

* Update .travis.yml

* nltk troubles

* some final cleanup

* if it aint broke...

* new corpora

in English!!

* hotfix to add timestamp as corpus identifier

* Skl compatibility (#41)

* Add sklearn 0.17 compatibility

Paper over library reorganization.

* renamed corpora to corpus, added deprecation warning (#42)

* renamed corpora to corpus, added deprecation warning
* moved load_driver and set up for future forcing of full imports of submodules

Closes #31

* S3 drivers (#44)

* initial working commit for s3 driver and database driver

* removing 3.6 formatting

* adding extra requirements list

* adding basic s3 driver test

* Removing unnecessary function

* This ain't 2007

* test updates

* adding s3driver to new corpus structure

* Rounding (#45)

* bumped version

* Fix NLTK loading bug

Fix evaluation order when NLTK is not present
OliverSherouse added a commit that referenced this pull request May 21, 2018
* hotfix to add timestamp as corpus identifier (#39)

* bumped version

* Release 0.4 (#47)

* Inaugurated 0.4.0 dev series

* Sentiment analysis (#33)

Closes #11 #12  #13 and adds Sentiment analysis!

* complexity

* complexity builtins

* complexity builtins with tests

* code review updates

* option tests

* added nltk requirement

in setup.py

* add pip install to .travis.yml

* nltk fixes

* another nltk fix

* last nltk fix?

* you know the drill

* Update .travis.yml

* nltk troubles

* some final cleanup

* if it aint broke...

* textblob sentiment

* tests and error raising

* fixed install req

* pep8 fixes

* code review updates

* fix travis file

* import fixes

* small fix

* Test corpora (#35)

* complexity

* complexity builtins

* complexity builtins with tests

* code review updates

* option tests

* added nltk requirement

in setup.py

* add pip install to .travis.yml

* nltk fixes

* another nltk fix

* last nltk fix?

* you know the drill

* Update .travis.yml

* nltk troubles

* some final cleanup

* new corpora

in English!!

* hotfix to add timestamp as corpus identifier

* Skl compatibility (#41)

* Add sklearn 0.17 compatibility

Paper over library reorganization.

* renamed corpora to corpus, added deprecation warning (#42)

* renamed corpora to corpus, added deprecation warning
* moved load_driver and set up for future forcing of full imports of submodules

Closes #31

* S3 drivers (#44)

* initial working commit for s3 driver and database driver

* removing 3.6 formatting

* adding extra requirements list

* adding basic s3 driver test

* Removing unnecessary function

* This ain't 2007

* test updates

* adding s3driver to new corpus structure

* Rounding (#45)

* bumped version

* Fix NLTK loading bug

Fix evaluation order when NLTK is not present
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.

3 participants