flex-cartesian 0.1.2 → 0.1.3

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 (2) hide show
  1. checksums.yaml +4 -4
  2. metadata +2 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96675f38efe3e792ac84749a93c495b5770de5b0b918331274b9f53999940a7a
4
- data.tar.gz: 0313d03ed02f6e568a803403628fdf1dedf5af9b883575d702b15a12dbf166dd
3
+ metadata.gz: 6da0e2d7afc6efca08b21663c3a4d7e80a924fb1707b02aae11c866a515fc067
4
+ data.tar.gz: dfd7f4fb1f71ec9ed4f469831a3efca245e43fe379fc7af51b6a708842906bdf
5
5
  SHA512:
6
- metadata.gz: 6bd8c8a7dca528707bb800b7f2fed94c6fe0fbcd1fcc2e114eb00d66505f8928a0afd88e7e38794d21cbe1c2be3813d9d43d7232b3e1d37583d0d19910ff1694
7
- data.tar.gz: 16049ce389e509ca7264ea1b5752c6bd539270d63f211cf95e08a386bf9a3f6d67ba5615cb6fc4efca9033a01a70b1bd631b083f2f2ad6614f29850d2fe68ea7
6
+ metadata.gz: 5afd71db98e0446c6e32478ec41db552811d68b3e40b915d34193c7d6ca9065ab19ebe154612886fa755074ace224b8db6799a9657710ca658af64671f4fc327
7
+ data.tar.gz: 49affdbb1e79d165f51f4e1698d3948dfb5e0e3de543711f39696cf0a7ab5bb355f8cb35eb98d7cfd64cfd69db228a473744de27e647e61a6ebbf6bd01a0aada
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flex-cartesian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Rassokhin
@@ -71,50 +71,7 @@ description: |
71
71
  Supports dimension-agnostic iteration, named dimensions, structured output,
72
72
  lazy/eager evaluation, progress bar, JSON/YAML loading, and export to Markdown/CSV.
73
73
 
74
- Example:
75
-
76
- require 'flex-cartesian'
77
-
78
- # Define Cartesian space with named dimensions:
79
- example = {
80
- dim1: [1, 2],
81
- dim2: ['x', 'y'],
82
- dim3: [true, false]
83
- }
84
- s = FlexCartesian.new(example)
85
-
86
- # Iterate over all combinations and calculate function on each combination:
87
- s.cartesian { |v| puts "#{v.dim1}-#{v.dim2}" if v.dim3 }
88
-
89
- # Get number of Cartesian combinations:
90
- puts "Total size: #{s.size}"
91
-
92
- # Convert Cartesian space to array of combinations
93
- array = s.to_a(limit: 3)
94
- puts array.inspect
95
-
96
- def do_something(v)
97
- end
98
-
99
- # Display progress bar (useful for large Cartesian spaces)
100
- s.progress_each { |v| do_something(v) }
101
-
102
- # Print Cartesian space as table
103
- s.output(align: true)
104
-
105
- # Lazy evaluation without materializing entire Cartesian product in memory:
106
- s.cartesian(lazy: true).take(2).each { |v| puts v.inspect }
107
-
108
- # Load from JSON or YAML
109
- File.write('example.json', JSON.pretty_generate(example))
110
- s = FlexCartesian.from_json('example.json')
111
- s.output
112
-
113
- # Export to Markdown
114
- s.output(format: :markdown, align: true)
115
-
116
- # Export to CSV
117
- s.output(format: :csv)
74
+ Code example: https://github.com/Yuri-Rassokhin/flex-cartesian/blob/main/README.md#usage
118
75
  email:
119
76
  - yuri.rassokhin@gmail.com
120
77
  executables: []