namo.rb 0.32.8 → 0.32.9

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -6
  3. data/lib/Namo/VERSION.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4889db6dce5c63a9cc355e5b68611a33cb1dacbe94f678a6b11cd0a5c5c3fb0c
4
- data.tar.gz: 561246d0002efb96b1235fbf7d64b20e4816217a78757477a2784a016e5a94c2
3
+ metadata.gz: 1ac4c2ed4449845cc475c09c946ae8af32b1ba977bed2353b1a665d597e108e5
4
+ data.tar.gz: 6e221c9bbe2cfc562018b57fdbd4b8476868c203385bc3ca1d9dbd19c209dda0
5
5
  SHA512:
6
- metadata.gz: 130de24b9419ccb107195ae5205dda09c5f46fd996dba9f38ea976a19619e9718cbb1d812810cf737571b955f1438e4651bfd6a39d5d5c8cf4a709b62cfb4596
7
- data.tar.gz: c4c90a3798c7caf69e19c069979f423648c64fa8d53dd9122da8187d5d7e2db3f70d2e463d5b922ea61fe6d4fe53fc16cdc0cf1d98138a905f7603baf08a294f
6
+ metadata.gz: f9331f7db05e3764548010efdc808f09b12f183a31ff6c6655f0a90644653128ce3696062b090921f47f941441a0a1d92f676a2b54a8c1e3c53aabbbeecafbcc
7
+ data.tar.gz: 511c00d86f20a981154be910d1345d309c6fdd45636e33a7bceeee626803a69f46553fa969495210f264d1f7921e6f29d3c800f1cb8f5b23592cc02e8e996371
data/CHANGELOG CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## 20261102
4
4
 
5
+ 0.32.9: + comparison/setup: Builds the environments the comparison/*_claims scripts run in, at the versions COMPARISON.md names, or with --latest the newest releases.
6
+
7
+ 1. + comparison/setup: Builds .venv/ with uv, and in .tools/ R and its packages with micromamba from conda-forge and Julia from its tarball, checked against the sha256 julialang.org publishes, with its packages; then removes the downloads and package caches. Pins pyarrow besides the packages COMPARISON.md names, since pandas stores strings with it where it is installed, which shows in what pandas_claims.py prints.
8
+ 2. ~ comparison/README.md: The setup instructions are comparison/setup, and each script runs with what it builds, where they had been the uv commands for Python and "given an environment" for R and Julia.
9
+ 3. ~ CHANGELOG: The 0.21.0 and 0.22.0 summaries end at their commit subjects, the rest moved into their numbered items; the 0.23.0 summary /body/collection/, as its commit subject has it.
10
+ 4. ~ Namo::VERSION: /0.32.8/0.32.9/
11
+
5
12
  0.32.8: ~ Namo::Row#match?: A Range selects by cover?, so beginless and endless ranges of Dates and Strings select rather than raising TypeError.
6
13
 
7
14
  1. ~ Namo::Row#match?: A Range is tested with cover? and an Array with include?, where both had been tested with include?, which raises for a beginless or endless range of anything not numeric. A bounded range of Strings now selects by ordering, as a bounded range of numbers already did, rather than by membership of its succ sequence.
@@ -306,7 +313,7 @@ A base Namo's constituents are formularies and rows: << dispatches a Module to a
306
313
 
307
314
  ## 20260627
308
315
 
309
- 0.23.0: + Namo::Formulary — A formulary is a reusable body of derived dimensions a Namo instance may draw upon.
316
+ 0.23.0: + Namo::Formulary — A formulary is a reusable collection of derived dimensions a Namo instance may draw upon.
310
317
 
311
318
  1. + lib/Namo/Formulary.rb: + Namo::Formulary, an empty marker module. A module includes it to brand itself a formulary; attach raises ArgumentError for an untagged module, so an ordinary module of helpers can't be mistaken for a body of derivations.
312
319
  2. ~ lib/Namo/Formulae.rb: + attach(modul), aliased as << — after the marker guard, extends a single memoised inert host (@host ||= Object.new) with the module and stores each of its public_instance_methods(false) as a Method bound to that host, then returns self. One host per Formulae across all attaches, so the bound Methods share a self-free receiver and a formulary method can't shadow Namo's API. No other change: derive, key?, required_parameter_count, keys, merge/dup/reject, and ==/eql?/hash are the 0.22.0 store-only methods, and they handle the formulary methods because the formulary methods are now store entries.
@@ -318,19 +325,19 @@ A base Namo's constituents are formularies and rows: << dispatches a Module to a
318
325
 
319
326
  ## 20260626
320
327
 
321
- 0.22.0: + Formulae#derive — move formula invocation out of Row#[] and into Formulae. [] keeps its meaning (the stored callable, as at 0.21.0); the new derive(name, row, namo, *arguments) resolves a named formula to its value. derive over call: the receiver is the collection, not the callable, so the verb says the collection derives a value via the named rule rather than borrowing Proc#call's "invoke the receiver"; and the result is whatever the proc returns, not necessarily numeric, which a neutral verb leaves open. Indexing a Formulae is storage access, not a Namo operation, so [] returning the callable carries no inconsistency with the dimension-value [] of Namo and Row — different domains, same spelling. Behaviour-preserving at the usage level: row[:revenue], namo[:x] = formula, values, and selections are unchanged.
328
+ 0.22.0: + Formulae#derive — move formula invocation out of Row#[] and into Formulae.
322
329
 
323
- 1. ~ lib/Namo/Formulae.rb: + derive(name, row, namo, *arguments), the formula resolver — invocation mechanics lifted whole from Row's formula branch (collection-scoped formulae are called (row, namo, *arguments), row-only formulae (row)). + required_parameter_count(name), public, a property of the stored callable. collection_scoped? and raise_unless_namo_context move in as private; the latter takes namo as a parameter rather than closing over Row's @namo. [] and []= are untouched — [] still returns the stored callable.
324
- 2. ~ lib/Namo/Row.rb: #[] delegates formula resolution to @formulae.derive(name, self, @namo, *arguments); Row keeps only the fail-fast argument guard, the formula-vs-data dispatch (@formulae.key?), and the data fallback (@row[name]). collection_scoped?, required_parameter_count, and raise_unless_namo_context are gone (now Formulae's). expected_argument_counts sources the count from @formulae.required_parameter_count and the fixed-vs-variadic check from @formulae[name].arity.
330
+ 1. ~ lib/Namo/Formulae.rb: + derive(name, row, namo, *arguments), the formula resolver — resolves a named formula to its value, the invocation mechanics lifted whole from Row's formula branch (collection-scoped formulae are called (row, namo, *arguments), row-only formulae (row)). derive over call: the receiver is the collection, not the callable, so the verb says the collection derives a value via the named rule rather than borrowing Proc#call's "invoke the receiver"; and the result is whatever the proc returns, not necessarily numeric, which a neutral verb leaves open. + required_parameter_count(name), public, a property of the stored callable. collection_scoped? and raise_unless_namo_context move in as private; the latter takes namo as a parameter rather than closing over Row's @namo. [] and []= are untouched — [] keeps its meaning, the stored callable as at 0.21.0: indexing a Formulae is storage access, not a Namo operation, so [] returning the callable carries no inconsistency with the dimension-value [] of Namo and Row — different domains, same spelling.
331
+ 2. ~ lib/Namo/Row.rb: #[] delegates formula resolution to @formulae.derive(name, self, @namo, *arguments); Row keeps only the fail-fast argument guard, the formula-vs-data dispatch (@formulae.key?), and the data fallback (@row[name]). collection_scoped?, required_parameter_count, and raise_unless_namo_context are gone (now Formulae's). expected_argument_counts sources the count from @formulae.required_parameter_count and the fixed-vs-variadic check from @formulae[name].arity. Behaviour-preserving at the usage level: row[:revenue], namo[:x] = formula, values, and selections are unchanged.
325
332
  3. + test/Namo/Formulae_test.rb: + #derive tests (row-only to value, collection-scoped with namo context, missing-namo-context raise, parameterised with arguments) and + #required_parameter_count tests (row-only, collection-scoped, parameterised, variadic). The #[] and #[]= blocks are unchanged — [] still returns the callable.
326
333
  4. ~ test/Namo/Row_test.rb: the formulae fixture is a Namo::Formulae, not a bare {} — Row now delegates formula resolution to its collaborator (call, required_parameter_count), which production always wraps (lib/namo.rb initialize). The data-only equality/match tests keep their {} literals: they never resolve a formula, so Hash#key? alone answers.
327
334
  5. ~ Namo::VERSION: /0.21.0/0.22.0/
328
335
 
329
336
  ## 20260625
330
337
 
331
- 0.21.0: + Namo::Formulae; @formulae: /Hash/Namo::Formulae/. Behaviour-preserving: no new capability, just an object for the formula collection to accrete behaviour onto later, mirroring the 0.1.0 extraction of Row.
338
+ 0.21.0: + Namo::Formulae; @formulae: /Hash/Namo::Formulae/.
332
339
 
333
- 1. + lib/Namo/Formulae.rb: + Namo::Formulae, a thin class wrapping a Hash @store. Responds to exactly the subset of Hash that lib/namo.rb and Row send the formula collection: [], []=, keys, key?, empty?, each, delete, merge, reject, dup; includes Enumerable (each yields [name, callable] pairs, giving map/select/etc. for free). Three deliberate choices: to_h returns a copy (@store.dup) so callers cannot mutate internals; ==/eql?/hash are names-only (keys.sort), matching Namo's own formula equality where two sets with the same names but different proc objects are equivalent; merge/reject/dup return a Formulae, not a Hash.
340
+ 1. + lib/Namo/Formulae.rb: + Namo::Formulae, a thin class wrapping a Hash @store. Behaviour-preserving: no new capability, just an object for the formula collection to accrete behaviour onto later, mirroring the 0.1.0 extraction of Row. Responds to exactly the subset of Hash that lib/namo.rb and Row send the formula collection: [], []=, keys, key?, empty?, each, delete, merge, reject, dup; includes Enumerable (each yields [name, callable] pairs, giving map/select/etc. for free). Three deliberate choices: to_h returns a copy (@store.dup) so callers cannot mutate internals; ==/eql?/hash are names-only (keys.sort), matching Namo's own formula equality where two sets with the same names but different proc objects are equivalent; merge/reject/dup return a Formulae, not a Hash.
334
341
  2. ~ lib/namo.rb: + the require; initialize now normalises the incoming formulae to a Formulae (Formulae.new(formulae) unless already one). This is the single behavioural seam — every existing internal construction passes a Hash and is wrapped, while operator results that now pass a Formulae (merge/dup return Formulae) pass through. No other call site changed: each sends a message Formulae answers.
335
342
  3. ~ test/namo_test.rb: the two assertions comparing the public #formulae accessor to a literal {} now assert emptiness (must_be_empty). The accessor returns a Formulae, not a Hash; the formula set being empty is the unchanged behaviour these tests pin. + two construction tests pinning the normalisation seam: a Hash given by keyword is wrapped in a Formulae, and a Formulae given by keyword passes through unchanged (same object).
336
343
  4. + test/Namo/Formulae_test.rb: + unit test pinning the three deliberate choices (to_h copy, names-only ==/eql?/hash, the Hash-compatible surface plus Enumerable map/select).
data/lib/Namo/VERSION.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Namo::VERSION
3
3
 
4
4
  class Namo
5
- VERSION = '0.32.8'
5
+ VERSION = '0.32.9'
6
6
  end
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.8
4
+ version: 0.32.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran