ctioga2 0.11 → 0.12
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 +17 -0
- data/lib/ctioga2/commands/commands.rb +2 -1
- data/lib/ctioga2/commands/doc/documentation-commands.rb +2 -1
- data/lib/ctioga2/commands/doc/html.rb +27 -0
- data/lib/ctioga2/commands/general-commands.rb +13 -0
- data/lib/ctioga2/commands/type.rb +1 -1
- data/lib/ctioga2/data/dataset.rb +210 -0
- data/lib/ctioga2/data/stack.rb +1 -1
- data/lib/ctioga2/graphics/elements/primitive.rb +8 -6
- data/lib/ctioga2/graphics/elements/subplot.rb +0 -7
- data/lib/ctioga2/graphics/elements/tangent.rb +3 -1
- data/lib/ctioga2/graphics/elements/xyz-map.rb +47 -28
- data/lib/ctioga2/graphics/styles.rb +1 -0
- data/lib/ctioga2/graphics/styles/arrows.rb +141 -1
- data/lib/ctioga2/graphics/styles/axes.rb +18 -1
- data/lib/ctioga2/graphics/styles/base.rb +41 -2
- data/lib/ctioga2/graphics/styles/box.rb +1 -1
- data/lib/ctioga2/graphics/styles/drawable.rb +60 -54
- data/lib/ctioga2/graphics/styles/errorbar.rb +10 -3
- data/lib/ctioga2/graphics/styles/factory.rb +80 -9
- data/lib/ctioga2/graphics/styles/plot.rb +1 -1
- data/lib/ctioga2/graphics/styles/scope.rb +72 -0
- data/lib/ctioga2/graphics/styles/sets.rb +2 -1
- data/lib/ctioga2/graphics/types.rb +1 -1
- data/lib/ctioga2/graphics/types/dimensions.rb +48 -0
- data/lib/ctioga2/log.rb +12 -0
- data/lib/ctioga2/metabuilder/type.rb +32 -20
- data/lib/ctioga2/metabuilder/types/strings.rb +2 -2
- data/lib/ctioga2/plotmaker.rb +14 -0
- data/lib/ctioga2/utils.rb +51 -3
- data/lib/ctioga2/version.rb +2 -2
- metadata +5 -3
data/lib/ctioga2/plotmaker.rb
CHANGED
@@ -221,6 +221,11 @@ module CTioga2
|
|
221
221
|
|
222
222
|
# The stack of CurveStyle objects that were used so far.
|
223
223
|
attr_accessor :curve_style_stack
|
224
|
+
|
225
|
+
# Whether or not one should pause at the end if there are
|
226
|
+
# errors. Useful on windows, where the windows closes before one
|
227
|
+
# has a chance to see anything.
|
228
|
+
attr_accessor :pause_on_errors
|
224
229
|
|
225
230
|
|
226
231
|
# The first instance of PlotMaker created
|
@@ -291,6 +296,15 @@ module CTioga2
|
|
291
296
|
debug { format_exception(e) }
|
292
297
|
fatal { "#{e.message}" }
|
293
298
|
end
|
299
|
+
errs = Log.counts[:error]
|
300
|
+
warns = Log.counts[:warn]
|
301
|
+
if errs + warns > 0
|
302
|
+
puts "ctioga2 finished with #{errs} errors and #{warns} warning"
|
303
|
+
if @pause_on_errors
|
304
|
+
puts "Hit ENTER to exit"
|
305
|
+
STDIN.gets
|
306
|
+
end
|
307
|
+
end
|
294
308
|
end
|
295
309
|
|
296
310
|
# Flushes the current root object and starts a new one:
|
data/lib/ctioga2/utils.rb
CHANGED
@@ -144,7 +144,7 @@ module CTioga2
|
|
144
144
|
return formula
|
145
145
|
end
|
146
146
|
|
147
|
-
|
147
|
+
# Sorts strings according to their numeric suffix
|
148
148
|
def self.suffix_numeric_sort(strings)
|
149
149
|
strings.sort do |a,b|
|
150
150
|
a =~ /.*?(\d+)$/
|
@@ -232,6 +232,13 @@ module CTioga2
|
|
232
232
|
return Math.log10(a.first).send(method)
|
233
233
|
end
|
234
234
|
|
235
|
+
# Returns the segment scaled about its center by the given factor
|
236
|
+
def self.scale_segment(left, right, factor)
|
237
|
+
dx = 0.5*(right - left)
|
238
|
+
mid = 0.5*(right + left)
|
239
|
+
return mid - factor * dx, mid + factor * dx
|
240
|
+
end
|
241
|
+
|
235
242
|
|
236
243
|
# Transcodes the given string from all encodings into the target
|
237
244
|
# encoding until an encoding is found in which the named file
|
@@ -278,6 +285,39 @@ module CTioga2
|
|
278
285
|
return ret
|
279
286
|
end
|
280
287
|
|
288
|
+
# Takes a vector, and splits it into a series of contiguous
|
289
|
+
# subvectors which
|
290
|
+
def self.split_homogeneous_deltas(vect, tolerance = 1e-4)
|
291
|
+
rv = []
|
292
|
+
idx = 1
|
293
|
+
dx = nil
|
294
|
+
lst = nil
|
295
|
+
while idx < vect.size
|
296
|
+
cdx = vect[idx] - vect[idx - 1]
|
297
|
+
if ! dx
|
298
|
+
dx = cdx
|
299
|
+
lst = Dobjects::Dvector.new()
|
300
|
+
rv << lst
|
301
|
+
lst << vect[idx-1] << vect[idx]
|
302
|
+
else
|
303
|
+
if (cdx - dx).abs <= tolerance * dx
|
304
|
+
# keep going
|
305
|
+
lst << vect[idx]
|
306
|
+
else
|
307
|
+
dx = nil
|
308
|
+
end
|
309
|
+
end
|
310
|
+
idx += 1
|
311
|
+
end
|
312
|
+
|
313
|
+
# Flush the last one if alone
|
314
|
+
if ! dx
|
315
|
+
nv = Dobjects::Dvector.new()
|
316
|
+
nv << vect.last
|
317
|
+
rv << nv
|
318
|
+
end
|
319
|
+
return rv
|
320
|
+
end
|
281
321
|
|
282
322
|
|
283
323
|
# Cross-platform way of finding an executable in the $PATH.
|
@@ -348,8 +388,7 @@ module CTioga2
|
|
348
388
|
end
|
349
389
|
|
350
390
|
return ret
|
351
|
-
|
352
|
-
|
391
|
+
end
|
353
392
|
|
354
393
|
# Returns a hash value -> [elements] in which the elements are in
|
355
394
|
# the same order
|
@@ -554,6 +593,15 @@ class Hash
|
|
554
593
|
self.delete(old)
|
555
594
|
end
|
556
595
|
|
596
|
+
# Strip the given keys if they evaluate to false
|
597
|
+
def strip_if_false!(keys)
|
598
|
+
for k in keys
|
599
|
+
if key?(k) and (not self[k])
|
600
|
+
self.delete(k)
|
601
|
+
end
|
602
|
+
end
|
603
|
+
end
|
604
|
+
|
557
605
|
end
|
558
606
|
|
559
607
|
|
data/lib/ctioga2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ctioga2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.12'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Fourmond <vincent.fourmond@9online.fr>
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tioga
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/ctioga2/graphics/styles/map-axes.rb
|
129
129
|
- lib/ctioga2/graphics/styles/plot-types.rb
|
130
130
|
- lib/ctioga2/graphics/styles/plot.rb
|
131
|
+
- lib/ctioga2/graphics/styles/scope.rb
|
131
132
|
- lib/ctioga2/graphics/styles/sets.rb
|
132
133
|
- lib/ctioga2/graphics/styles/styles.rb
|
133
134
|
- lib/ctioga2/graphics/styles/stylesheet.rb
|
@@ -161,7 +162,8 @@ files:
|
|
161
162
|
- lib/ctioga2/version.rb
|
162
163
|
- setup.rb
|
163
164
|
homepage: http://ctioga2.sourceforge.net
|
164
|
-
licenses:
|
165
|
+
licenses:
|
166
|
+
- GPL-2.0+
|
165
167
|
metadata: {}
|
166
168
|
post_install_message:
|
167
169
|
rdoc_options: []
|