-
Notifications
You must be signed in to change notification settings - Fork 7
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
ResultSet and Metadata implementation #36
Conversation
…t info from handler.
Codecov Report
@@ Coverage Diff @@
## master #36 +/- ##
==========================================
+ Coverage 94.97% 95.42% +0.44%
==========================================
Files 4 7 +3
Lines 697 743 +46
==========================================
+ Hits 662 709 +47
+ Misses 35 34 -1
Continue to review full report at Codecov.
|
…ullresult funciton, commented out experiemental code for IterableTables, updated unit test to include iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
README.md
Outdated
|
||
It's OK to access the fields directly. | ||
```julia | ||
julia> fieldnames(md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to be compatible with 0.7 and onward, this line should read fieldnames(typeof(md))
. There was a discussion on Slack or Discourse, can't remember which.
README.md
Outdated
|
||
```julia | ||
julia> metadata(handler) | ||
SASLib.Metadata("productsales.sas7bdat", "US-ASCII", :LittleEndian, :none, 8192, 18, 1440, 10, Pair{Symbol,DataType}[:ACTUAL=>Float64, :PREDICT=>Float64, :COUNTRY=>String, :REGION=>String, :DIVISION=>String, :PRODTYPE=>String, :PRODUCT=>String, :QUARTER=>Float64, :YEAR=>Float64, :MONTH=>Float64]) | ||
``` | ||
|
||
## Why another package? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this package has matured quite a bit and keeps getting better. Its functionality is moving beyond just a port of some Python code. At this point, you might not need this section anymore. This isn't just a package you made for your own purposes, this is becoming the best way to use SAS files in Julia. I'd suggest merging this section and the one below it into 1 section titled Notes and just have 1 sentence that says something to the effect of "The core functionality of this package borrowed inspiration from Pandas' read_sas
and ReadStat.jl
."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree 💯
…h a new Related Packages section
@tbeason do you have time to beta test this? I would like to know how it well it works and if there's any other related change requests. |
I can test it out on Monday. You're working at lightning speed! |
sounds good! enjoy your weekend! |
This seems to be working well! I like these changes. I tested on v0.6.2 and on v0.7. It works on both. The Printing-wise, the entire floating point number prints. For display purposes, might be good to truncate after so many decimal places. I'd change the show function for the Read performance seems to have increased quite a bit as well, but I didn't do any formal benchmarks. Still seeing improvements on v0.7 relative to v0.6.2 as well. Would perhaps be nice to define a convenience constructor |
Yes, that would require a dependency on DataFrames.jl. Once this package here is more stable I plan to switch StatFiles.jl over to use it, and then you should be able to just do |
Hi @tbeason, great feedbacks!
I wanted to draw a line somewhere such that I don't end up turning
This is an interesting observation. The current design uses numbers for row indexing and symbols for column indexing. Hence it's unambiguous and that's also why
Using symbols for column selection may sound a bit inflexible but can be easily worked around by mapping and splatting it inside:
This is a standard behavior with tuples. Not sure how I can change that without implementing a new display. For example:
Agree. I can add a |
I would rather not make the package depend on DataFrames.jl. Seems overkill for just having a constructor that saves few keystrokes. Doing If we implement |
As far as subsetting/indexing, I see your point. I suppose another way to view the current indexing is to think about it as iterating through rows just like SAS does. And ultimately, I think most analysis will probably be done by converting the @davidanthoff is obviously the one to comment on |
That's right. The user is encouraged to convert it to DataFrame for more complex queries/manipulation. |
Also, these are some fairly breaking changes. I am not super familiar with Another approach is to do what ShiftedArrays.jl is doing right now. They print a message during precompilation to tell you that functionality has changed. |
Good point! I don't know how deprecation would work in this scenario though since method signatures are not changed but rather the return type is different. As the package is relatively new, I'm hoping the impact (in terms of number people affected by this) isn't too big. I would rather not keep old behavior around -- if that's what a user want, just check out the older version from github. The way that ShiftedArrays displays the warning is quite brilliant. That looks like an easy change. In addition, I can put up notice near the top of README. |
This reverts commit 4b03b91.
For #29, #30 and #31