namo.rb 0.32.5 → 0.32.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +27 -1
- data/README.md +2 -0
- data/lib/Namo/Enumerable.rb +10 -1
- data/lib/Namo/VERSION.rb +1 -1
- data/namo.rb.gemspec +1 -1
- data/test/namo_test.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5fda18e18a9c3488c9cb656c58fa37829cbbccee784a130d5bf372b7585b609c
|
|
4
|
+
data.tar.gz: 815833d6e4053c8bf17e49300d2ded7d0f0bf511a5d768cc592275d3e9660090
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1683fc421428bb5542dad678a72985eb449abd7a15d9a3fd20f2cb35cbbc7a77053c479241107f43e79991fa9512a51354552cb8f540c607fd0d095dece8ca50
|
|
7
|
+
data.tar.gz: 7ecb0767c29e88d6c15099db2a20685a0fdf2e963b9ce706ed29ee350639fb77ddacb1166198bd2d15f2379963ccf52bd62f9f374729e7174ac596c9cce34ea1
|
data/CHANGELOG
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
# CHANGELOG
|
|
1
|
+
# namo/CHANGELOG
|
|
2
|
+
|
|
3
|
+
## 20261102
|
|
4
|
+
|
|
5
|
+
0.32.7: ~ COMPARISON.md: Verify and where necessary correct claims made about pandas, Polars, xarray, dplyr, and DataFrames.jl; + comparison/*_claims, which contain executable verification code.
|
|
6
|
+
|
|
7
|
+
1. + comparison/namo_claims.rb, pandas_claims.py, polars_claims.py, xarray_claims.py, dplyr_claims.R, dataframes_claims.jl: each runs every snippet COMPARISON.md shows for its tool, on inline data, then the probes behind its claims.
|
|
8
|
+
2. ~ COMPARISON.md: + the versions compared and a pointer to the scripts; the date is the day of checking.
|
|
9
|
+
3. ~ COMPARISON.md: Polars: `filter` takes keyword equality; one `with_columns` doesn't see the columns it makes; `melt` is `unpivot` and `frame_equal` is gone; `join_where`, `pl.Schema` and `assert_frame_equal(check_row_order=False)` added where they answer a "none offers" claim.
|
|
10
|
+
4. ~ COMPARISON.md: pandas: a join with no `on=` doesn't warn; `.loc` takes rows and columns in one call, and a callable; strings infer as `str`, not `object`; registered accessors noted against parameterised formulae and formularies.
|
|
11
|
+
5. ~ COMPARISON.md: xarray: `.str` on coordinates and string data variables; `sel` with a scalar, a list and a slice in one call, and none over repeated labels; `sel(method='ffill')` as an asof lookup; `where` with `drop=True` and a callable; `identical`/`equals`/`broadcast_equals`.
|
|
12
|
+
6. ~ COMPARISON.md: dplyr: `symdiff()`, `setequal()`, `cross_join()` and `join_by()`'s rolling and inequality joins exist; a join with no `by` messages rather than warns; `all_equal()` gave way to `all.equal()`; a tibble keeps no row names; `filter()` wants vectorised predicates; zoo's `rollmean` centres its window, so the snippets take `align = 'right'`.
|
|
13
|
+
7. ~ COMPARISON.md: DataFrames.jl: `==` returns one Bool; `symdiff` works on Sets of rows; `Tables.columntable` is the columnar conversion; the rolling snippets pad `rollmean` under `transform`, `combine` having refused windows of two lengths.
|
|
14
|
+
8. ~ COMPARISON.md: the summaries those contradicted narrowed, and unsourced claims dropped; + at 0.32.7 a beginless range of Dates or Strings raises `TypeError` in selection, so the windowed formulae want numeric dates.
|
|
15
|
+
9. ~ comparison/README.md: + the claims scripts.
|
|
16
|
+
10. ~ .gitignore: + comparison/.venv/, comparison/.tools/.
|
|
17
|
+
11. ~ namo.rb.gemspec: the gemspec heads the file list, as in namo.gemspec.
|
|
18
|
+
12. ~ CHANGELOG: the heading names the project, `# namo/CHANGELOG`; + the 0.32.6 entry, which 0.32.6 shipped without.
|
|
19
|
+
13. ~ Namo::VERSION: /0.32.6/0.32.7/
|
|
2
20
|
|
|
3
21
|
## 20261003
|
|
4
22
|
|
|
23
|
+
0.32.6: ~ Namo::Enumerable#group_by: the block form and the no-argument call raise errors which say what to do instead.
|
|
24
|
+
|
|
25
|
+
1. ~ Namo::Enumerable#group_by: When called with a block, it raises an ArgumentError naming the block form as unimplemented and entries.group_by{|row| ...} as the way to partition by a computed key, where Ruby's arity error said only that the count was wrong — which told the reader something was broken rather than that the boundary was drawn at 0.20.0, a computed key having no dimension to round-trip through.
|
|
26
|
+
2. ~ Namo::Enumerable#group_by: When called with no argument, it raises 'group_by needs a dimension' rather than the same arity error.
|
|
27
|
+
3. ~ README.md: The group_by section says it takes a dimension and no block, and what entries.group_by returns instead.
|
|
28
|
+
4. ~ ROADMAP.md: + 0.32.6; + the optimisation candidates already in view, parked under 1.1 until there is a baseline to measure them against.
|
|
29
|
+
5. ~ Namo::VERSION: /0.32.5/0.32.6/
|
|
30
|
+
|
|
5
31
|
0.32.5: Documentation clean up.
|
|
6
32
|
|
|
7
33
|
1. ~ README.md: + what Symbol#-@ costs, and why `/` dedupes.
|
data/README.md
CHANGED
|
@@ -1295,6 +1295,8 @@ prices.group_by(:value_score)
|
|
|
1295
1295
|
|
|
1296
1296
|
This gives a single inversion law over the whole namespace — `namo.group_by(d).as_detail(d) == namo[*namo.data_dimensions, d]` for any `d`, with the exact-original round-trip being the data-dimension instance of it. A nil-valued group produces a nil-named member, holding its rows and round-tripping like any other.
|
|
1297
1297
|
|
|
1298
|
+
`group_by` takes a dimension and no block. The block form `Enumerable#group_by` teaches is not implemented — the groups a computed key makes would have no dimension to round-trip through on `as_detail` — and it says so when called; partitioning by a computed key drops to Ruby, where `prices.entries.group_by{|row| row[:symbol]}` returns the `{key => [Row]}` hash `Enumerable#group_by` always returned.
|
|
1299
|
+
|
|
1298
1300
|
## Name
|
|
1299
1301
|
|
|
1300
1302
|
Namo: nam(ed) (dimensi)o(ns). A companion to Numo (numeric arrays for Ruby). And in Aussie culture 'o' gets added to the end of names.
|
data/lib/Namo/Enumerable.rb
CHANGED
|
@@ -69,7 +69,16 @@ class Namo
|
|
|
69
69
|
]
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
# The block form is the call Enumerable#group_by makes, and it is not
|
|
73
|
+
# implemented: the groups a computed key makes have no dimension to
|
|
74
|
+
# round-trip through on as_detail. The raise says so and names the way to
|
|
75
|
+
# partition by one, where Ruby's arity error said only that the count was
|
|
76
|
+
# wrong; a call with no dimension at all gets its own sentence.
|
|
77
|
+
def group_by(dimension = nil)
|
|
78
|
+
if block_given?
|
|
79
|
+
raise ArgumentError, 'the block form of group_by is not implemented; entries.group_by{|row| ...} partitions by a computed key'
|
|
80
|
+
end
|
|
81
|
+
raise ArgumentError, 'group_by needs a dimension' if dimension.nil?
|
|
73
82
|
collection = Collection.new
|
|
74
83
|
source = derived_dimensions.include?(dimension) ? self[*data_dimensions, dimension] : self
|
|
75
84
|
members = (
|
data/lib/Namo/VERSION.rb
CHANGED
data/namo.rb.gemspec
CHANGED
|
@@ -27,13 +27,13 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.require_paths = ['lib']
|
|
28
28
|
|
|
29
29
|
spec.files = [
|
|
30
|
+
'namo.rb.gemspec',
|
|
30
31
|
Dir['bin/*'],
|
|
31
32
|
Dir['lib/**/*.rb'],
|
|
32
33
|
Dir['test/**/*.rb'],
|
|
33
34
|
'CHANGELOG',
|
|
34
35
|
'Gemfile',
|
|
35
36
|
'LICENSE',
|
|
36
|
-
'namo.rb.gemspec',
|
|
37
37
|
'Rakefile',
|
|
38
38
|
'README.md',
|
|
39
39
|
].flatten
|
data/test/namo_test.rb
CHANGED
|
@@ -3234,6 +3234,18 @@ describe Namo do
|
|
|
3234
3234
|
end
|
|
3235
3235
|
end
|
|
3236
3236
|
|
|
3237
|
+
context "the boundary of the call" do
|
|
3238
|
+
it "raises informatively on the block form, which is not implemented" do
|
|
3239
|
+
error = _(proc{prices.group_by{|row| row[:symbol]}}).must_raise ArgumentError
|
|
3240
|
+
_(error.message).must_match(/entries\.group_by/)
|
|
3241
|
+
end
|
|
3242
|
+
|
|
3243
|
+
it "raises informatively with no dimension at all" do
|
|
3244
|
+
error = _(proc{prices.group_by}).must_raise ArgumentError
|
|
3245
|
+
_(error.message).must_match(/dimension/)
|
|
3246
|
+
end
|
|
3247
|
+
end
|
|
3248
|
+
|
|
3237
3249
|
context "single-pass assembly" do
|
|
3238
3250
|
# Collection#<< rebuilds @data = detail.data over all members-so-far on every
|
|
3239
3251
|
# append, so appending one member per group re-materialised the data g times
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: namo.rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.32.
|
|
4
|
+
version: 0.32.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoran
|
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
105
105
|
- !ruby/object:Gem::Version
|
|
106
106
|
version: '0'
|
|
107
107
|
requirements: []
|
|
108
|
-
rubygems_version: 4.0.
|
|
108
|
+
rubygems_version: 4.0.23
|
|
109
109
|
specification_version: 4
|
|
110
110
|
summary: Named dimensional data for Ruby.
|
|
111
111
|
test_files: []
|