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

Removes IO modules from Daru #430

Open
wants to merge 13 commits into
base: v-1-pre
Choose a base branch
from

Conversation

athityakumar
Copy link
Member

Through this PR, I'd like to safely port away all IO modules of Daru, keeping the Marshalling methods intact. I'll request a review in a couple of days.

@@ -710,7 +710,7 @@
end

RSpec.shared_examples 'correct macd' do |*args|
let(:source) { Daru::DataFrame.from_csv('spec/fixtures/macd_data.csv') }
let(:source) { Daru::DataFrame.read_csv('spec/fixtures/macd_data.csv') }
Copy link
Member Author

Choose a reason for hiding this comment

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

I somehow want to keep out the IO methods from the tests of daru. For example, a simple parsing error with daru-io could be misunderstood as a logical error with the method (of course, unless the error log is seen). Only 2 more fixture files are remaining - macd_data.csv and duplicates.csv. Can a truncated version of both these files be fed as manual data in the specs and then maybe remove both the files?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, for me an ability to use CSV fixtures in general Daru tests seems important, especially for future (more complicated stats methods and stuff). So let's leave this as is.

And I believe that daru-io errors would be clearly seen in specs, if the problem is daru-io

@@ -1,2 +1,3 @@
source 'https://rubygems.org'
gemspec
gem 'daru-io', :git => 'https://github.com/athityakumar/daru-io.git'
Copy link
Member Author

Choose a reason for hiding this comment

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

Will daru-io be a runtime_dependency or development_dependency of daru?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Runtime, of course. We need after gem install daru things like Daru::DF.from_csv to "just work".

@athityakumar athityakumar changed the title [WIP] Removes IO modules from Daru Removes IO modules from Daru Oct 10, 2017
@athityakumar
Copy link
Member Author

athityakumar commented Oct 10, 2017

@zverok - Ready for a review 😄

Edit : I'll fix the merge conflicts while fixing the above review comments.

Copy link
Collaborator

@zverok zverok left a comment

Choose a reason for hiding this comment

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

Please rebase from latest state of the branch (git pull --rebase upstream v-1-pre if remote sciruby/daru is named "upstream" on your machine), I've merged master and your PR shouldn't have unrelated

@@ -1,2 +1,3 @@
source 'https://rubygems.org'
gemspec
gem 'daru-io', :git => 'https://github.com/athityakumar/daru-io.git'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Runtime, of course. We need after gem install daru things like Daru::DF.from_csv to "just work".

#
# == Arguments
#
# * filename - Path of file where the vector is to be saved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's start to use proper YARD in all touched code. E.g. it should say

Save the vector to a file

@param filename [String] Path of file where the vector is to be saved

a = Daru::DataFrame.load(outfile.path)
expect(a).to eq(@data_frame)
end
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's just remove Marshal totally. Nobody uses it, and nobody should.

@@ -710,7 +710,7 @@
end

RSpec.shared_examples 'correct macd' do |*args|
let(:source) { Daru::DataFrame.from_csv('spec/fixtures/macd_data.csv') }
let(:source) { Daru::DataFrame.read_csv('spec/fixtures/macd_data.csv') }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, for me an ability to use CSV fixtures in general Daru tests seems important, especially for future (more complicated stats methods and stuff). So let's leave this as is.

And I believe that daru-io errors would be clearly seen in specs, if the problem is daru-io

daru.gemspec Outdated
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.1.0'

spec.add_runtime_dependency 'backports'
spec.add_runtime_dependency 'daru-io'
Copy link
Member Author

Choose a reason for hiding this comment

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

@zverok - daru-io and daru are both runtime_dependencies of each other, and that's creating an infinite loop in travis builds while bundle installing. :trollface:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, already thought of that. I believe that daru should be development dependency of daru-io (meaning since "daru 1.0" there is no sense in installing daru-io by itself, as it is installed with daru)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, should v0.1.1 be released for daru-io with this dependency change?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably so. At the same time when daru-1.0.0-pre would be released, probably?..

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, but this way we can't continue developing daru in this branch :philosoraptor:
OK, let's leave this branch with development dependency on daru-io, and then change that on release.

Copy link
Member Author

Choose a reason for hiding this comment

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

Acknowledged. Let me just add daru-io to the Gemfile rather than then gemspec, so that it doesn't interfere with travis CI builds. Before daru-1.0.0-pre release, this can be changed after daru-io-0.1.1 releases. Can you add this into the milestone?

@athityakumar
Copy link
Member Author

@zverok - Opened #434 for noting down the dependency issue. Can you add it into the milestone to keep track?

@zverok
Copy link
Collaborator

zverok commented Oct 16, 2017

Done.

@v0dro
Copy link
Member

v0dro commented May 30, 2020

This needs a serious relook and separating IO from the core gem should be seriously considered before the next major release.

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.

3 participants