panomosity 0.1.32 → 0.1.33

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50e125a826a4accf978aa182be59f36de59c7697254b3eabd27b6fb831fb319d
4
- data.tar.gz: 4b53136c72ddba3fd1515cd5b9aea76fa747abfff344ad9e485ad2026e407209
3
+ metadata.gz: dc51adbd45db0cbb937f28da56b8a589f633d0ce9cccccf885281536f6e24c9e
4
+ data.tar.gz: 651e257e87f066cd469c7cd1810dde92ed8674a3c68cec8210c59d009f59f38f
5
5
  SHA512:
6
- metadata.gz: 21a995367c4d62e67ccbdda9a18587cd7ddefc3399e585307bb8b47c7390276074889f8cccbc267c062eed3a46052dc55796fe0280ad9e27635642a758f0de73
7
- data.tar.gz: da2f34870a506e6b32d4a2be111b614fe2056b049df905d9c5738efa13ffb64c0f45fe02ac4b86f042ee8c692b7610e032ef8f0e0e94ddc835bc925226e79728
6
+ metadata.gz: fbda70377b5cf21a0f7c0b4cafadc18d6851143e5cafa7872f1332f126368df9b5182a11bfa0f8c00bed9572706b1cd5aa64a046e064ad29a354c34b5311a7b6
7
+ data.tar.gz: 294e882e7e3ee22a34e41c23db1c72091ad19467254e64ef85be40251f5bafa33b0c00415293f573ed18863eae4f6eb22ed83d3d54698793aa626f5e397e1078
@@ -70,6 +70,10 @@ module Panomosity
70
70
  options[:report_type] = type
71
71
  end
72
72
 
73
+ parser.on('--darwin', 'Sets a flag to indicate the operating system') do |type|
74
+ options[:darwin] = type
75
+ end
76
+
73
77
  parser.on('-h', '--help', 'Display this screen') do
74
78
  puts parser
75
79
  exit
@@ -501,7 +501,7 @@ module Panomosity
501
501
  images = Image.parse(@input_file)
502
502
  res = @options[:res] || 'low'
503
503
  columns = images.map(&:column).uniq.sort
504
- columns.each do |column|
504
+ commands = columns.map do |column|
505
505
  @output = "project_nona_c#{column}.pto"
506
506
  @output_file = File.new(@output, 'w')
507
507
  logger.debug "creating file #{@output}"
@@ -515,9 +515,19 @@ module Panomosity
515
515
  end.compact
516
516
  save_file
517
517
  logger.debug "running nona #{@output}"
518
- output = `nona --save-intermediate-images --intermediate-suffix=intermediate -v -m TIFF_m --seam=blend #{@output} -o #{res}_res_stitch_section_c#{column.to_s.rjust(5, '0')}_`
518
+ output = "nona --save-intermediate-images --intermediate-suffix=intermediate -v -m TIFF_m --seam=blend #{@output} -o #{res}_res_stitch_section_c#{column.to_s.rjust(5, '0')}_"
519
519
  logger.debug output
520
+ output
520
521
  end
522
+
523
+ logger.debug 'parallelizing'
524
+ if @options[:darwin]
525
+ parallel_command = "cat <<'EOF' | parallel \n#{commands.join("\n")}\nEOF"
526
+ else
527
+ parallel_command = "cat <<'EOF' | parallel -j $(fgrep -c processor /proc/cpuinfo) \n#{commands.join("\n")}\nEOF"
528
+ end
529
+
530
+ `#{parallel_command}`
521
531
  end
522
532
 
523
533
  def optimize
@@ -1,3 +1,3 @@
1
1
  module Panomosity
2
- VERSION = '0.1.32'
2
+ VERSION = '0.1.33'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panomosity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.32
4
+ version: 0.1.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler