datafarming 1.3.0 → 1.4.0

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.
@@ -0,0 +1,45 @@
1
+ #### COMMAND-LINE TOOLS
2
+
3
+ Ruby is a powerful and concise object-oriented scripting language. Scripts are normally run from a command-line or terminal environment by typing the `ruby` command followed by a script name, often followed by one or more command-line arguments. However, scripts installed as gems do not need the `ruby` command to be typed explicitly. For example, typing `stripheaderdups.rb my_file.txt` will invoke the `stripheaderdups.rb` script and apply it to file `my_file.txt` in your current working directory. Note that on Windows the `.rb` suffix is not needed to run your scripts, e.g., `stripheaderdups my_file.txt` will suffice.
4
+
5
+ All scripts in this distribution are self documenting if run with a `--help`, `-h`, or `-?` option. Quick descriptions follow.
6
+
7
+ #### DATA MANIPULATION
8
+ - `blank2csv.rb` —
9
+ convert whitespace-delimited files to Comma Separated Values (CSV) files
10
+ - `cat.rb` —
11
+ Unix `cat` program work-alike for Windows—for viewing or creating text files or concatenating multiple files, based on stdio
12
+ - `convert_line_endings.rb` —
13
+ convert text files (including CSV files) to your current operating system environment (e.g., DOS to Unix or Unix to DOS)
14
+ - `csv2blank.rb` —
15
+ convert CSV files to whitespace-delimited files
16
+ - `pool_files.rb` —
17
+ pool columns from separate files into a new file, useful for combining design file & output files or multiple output files
18
+ - `stripheaders.rb`, `stripheaderdups.rb` —
19
+ remove column headers from a file, or duplicate headers within a file, respectively
20
+
21
+ #### DESIGN GENERATORS
22
+ - `augment_design.rb` —
23
+ generate star points to augment an already existing factorial design
24
+ - `cross.rb` —
25
+ create a combinatorial design by crossing all combinations of any # of individual smaller designs
26
+ - `scaled_fde.rb` —
27
+ generate fully orthogonal quadratic designs based on discrete Fourier frequencies, with factor scaling
28
+ - `scaled_rf_cubed.rb` —
29
+ generate 2-level Resolution V fractional factorial designs and Central Composite Designs (CCDs), with factor scaling
30
+ - `stack_nolhs.rb` —
31
+ generate designs by reassigning columns from pre-tabled NOLHs, with factor scaling, for up to 100 factors
32
+
33
+ #### RUN CONTROL
34
+ - `batchrunner.rb` —
35
+ run a model interactively with replication
36
+ - `rundesign_general.rb` —
37
+ run control to replicate a designed experiment applied to a model
38
+
39
+ #### CONFIDENCE INTERVALS FOR TIME SERIES
40
+ - `mser.rb` —
41
+ use MSER truncation to remove initial transient effects for time-series output, reporting truncated average and number of observations for each run to facilitate construction of a properly weighted confidence interval.
42
+ - `mser_nolbm.rb` —
43
+ use MSER truncation to remove initial transient effects for time-series output, then calculate a 95% confidence interval on the remaining data using non-overlapping batch means.
44
+ - `mser_olbm.rb` —
45
+ use MSER truncation to remove initial transient effects for time-series output, then calculate a 95% confidence interval on the remaining data using overlapping batch means.
data/LICENSE.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  The MIT License (MIT)
3
3
 
4
- Copyright (c) 2017-2018 Paul J. Sanchez
4
+ Copyright (c) 2017-2021 Paul J. Sanchez
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ### SETUP
2
2
 
3
- This gem requires Ruby v2.3 or later to be installed on your system.
3
+ This gem requires Ruby v2.5 or later to be installed on your system.
4
4
  - On MacOS, Ruby comes pre-installed. Note: You can use the homebrew package manager from [brew.sh](https://brew.sh) if you want to install a newer version of Ruby which is noticeably faster than the one that currently ships with MacOS.
5
5
  - Windows users should use one of the installer packages available from [rubyinstaller.org](http://rubyinstaller.org/). You will need to determine whether your have a 32 or 64 bit processor, and download the appropriate installer. We recommend Ruby v2.5.x or later, as it is substantially faster than prior versions. When running the installer, check the checkboxes to add the Ruby installation to your PATH and to associate `.rb` and `.rbw` files with Ruby. A terminal window will pop up during the installation—press "enter" to automatically install all of the required tools, and when prompted again (several minutes later) press "enter" again to end the installation.
6
6
 
@@ -16,42 +16,6 @@ Gem installation only needs to be done once. If you explicitly downloaded the `
16
16
 
17
17
  ### USAGE
18
18
 
19
- Ruby is a powerful and concise object-oriented scripting language. Scripts are normally run from a command-line or terminal environment by typing the `ruby` command followed by a script name, often followed by one or more command-line arguments. However, scripts installed as gems do not need the `ruby` command to be typed explicitly. For example, typing `stripheaderdups.rb my_file.txt` will invoke the `stripheaderdups.rb` script and apply it to file `my_file.txt` in your current working directory. Note that on Windows the `.rb` suffix is not needed to run your scripts, e.g., `stripheaderdups my_file.txt` will suffice.
20
-
21
- All scripts in this distribution are self documenting if run with a `--help`, `-h`, or `-?` option. Quick descriptions follow.
22
-
23
- ### GENERAL FILE MANIPULATION SCRIPTS:
24
- - `blank2csv.rb` —
25
- converts whitespace-delimited files to Comma Separated Values (CSV) files
26
- - `cat.rb` —
27
- Unix “cat” program work-alike for Windows—for viewing or creating text files or concatenating multiple files, based on stdio
28
- - `convert_line_endings.rb` —
29
- converts text files (including CSV files) to your current operating system environment (e.g., DOS to Unix or Unix to DOS)
30
- - `csv2blank.rb` —
31
- converts CSV files to whitespace-delimited files
32
-
33
- ### DATA FARMING RUBY SCRIPTS:
34
- - `batchrunner.rb` —
35
- run a model interactively with replication
36
- - `rundesign_general.rb` —
37
- run control to replicate a designed experiment with a model
38
- - `pool_files.rb` —
39
- pool columns from separate files into a new file, useful for combining design file & output files or multiple output files
40
- - `scaled_fde.rb` —
41
- generate fully orthogonal quadratic designs based on discrete Fourier frequencies, with factor scaling
42
- - `scaled_rf_cubed.rb` —
43
- generate 2-level Resolution V fractional factorial designs and Central Composite Designs (CCDs), with factor scaling
44
- - `stack_nolhs.rb` —
45
- generate designs by reassigning columns from built-in NOLHs, with factor scaling, for up to 100 factors
46
- - `stripheaders.rb`, `stripheaderdups.rb` —
47
- used to remove headers from a file, or duplicate headers within a file, respectively
48
- - `augment_design.rb` —
49
- generates star points to augment a fractional factorial
50
- - `cross.rb` —
51
- creates a combinatorial design by crossing all combinations of any # of individual smaller designs
52
- - `mser.rb` —
53
- uses MSER truncation to remove initial transient effects for time-series output, reports truncated average and number of observations for each run to facilitate construction of a properly weighted confidence interval.
54
- - `mser_nolbm.rb` —
55
- uses MSER truncation to remove initial transient effects for time-series output, then calculates a 95% confidence interval on the remaining data using non-overlapping batch means.
56
- - `mser_olbm.rb` —
57
- uses MSER truncation to remove initial transient effects for time-series output, then calculates a 95% confidence interval on the remaining data using overlapping batch means.
19
+ Ruby is a powerful and concise object-oriented scripting language. Normally, Ruby scripts are run from a command-line or terminal environment by typing the `ruby` command followed by a script name, often followed by one or more command-line arguments. However, scripts installed as gems do not need the `ruby` command to be typed explicitly. For example, typing `stripheaderdups.rb my_file.txt` will invoke the `stripheaderdups.rb` script and apply it to file `my_file.txt` in your current working directory. Note that on Windows the `.rb` suffix is not needed to run your scripts, e.g., `stripheaderdups my_file.txt` will suffice.
20
+
21
+ You can run the command `datafarming.rb` at any point after installing to see descriptions of the various data farming utilities included in this distribution.
@@ -1,12 +1,12 @@
1
1
  # -*- ruby -*-
2
- _VERSION = "1.3.0"
2
+ _VERSION = "1.4.0"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "datafarming"
6
6
  s.version = _VERSION
7
- s.date = "2018-08-17"
7
+ s.date = "2021-01-19"
8
8
  s.summary = "Useful scripts for data farming."
9
- s.homepage = "https://gitlab.nps.edu/pjsanche/datafarmingrubyscripts.git"
9
+ s.homepage = "https://bitbucket.org/paul_j_sanchez/datafarmingrubyscripts"
10
10
  s.email = "pjs@alum.mit.edu"
11
11
  s.description = "Ruby scripts for data farming, including pre- and post-processing, design generation and scaling, and run control."
12
12
  s.author = "Paul J Sanchez"
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.add_runtime_dependency 'fwt', '~> 1.2'
20
20
  s.add_runtime_dependency 'colorize', '~> 0.8'
21
21
  s.add_runtime_dependency 'quickstats', '~> 2'
22
- s.required_ruby_version = '>= 2.3'
22
+ s.required_ruby_version = '>= 2.5'
23
23
  s.license = 'MIT'
24
24
  end
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lines = [
4
+ '',
5
+ ' #### COMMAND-LINE TOOLS',
6
+ '',
7
+ ' Ruby is a powerful and concise object-oriented scripting language. Scripts',
8
+ ' are normally run from a command-line or terminal environment by typing the',
9
+ ' ruby command followed by a script name, often followed by one or more',
10
+ ' command-line arguments. However, scripts installed as gems do not need the',
11
+ ' ruby command to be typed explicitly. For example, typing',
12
+ ' stripheaderdups.rb my_file.txt will invoke the stripheaderdups.rb script',
13
+ ' and apply it to file my_file.txt in your current working directory. Note',
14
+ ' that on Windows the .rb suffix is not needed to run your scripts, e.g.,',
15
+ ' stripheaderdups my_file.txt will suffice.',
16
+ '',
17
+ ' All scripts in this distribution are self documenting if run with a --help,',
18
+ ' -h, or -? option. Quick descriptions follow.',
19
+ '',
20
+ ' #### DATA MANIPULATION',
21
+ '',
22
+ ' • blank2csv.rb —',
23
+ ' convert whitespace-delimited files to Comma Separated Values (CSV) files',
24
+ ' • cat.rb —',
25
+ ' Unix cat program work-alike for Windows—for viewing or creating text files',
26
+ ' or concatenating multiple files, based on stdio',
27
+ ' • convert_line_endings.rb —',
28
+ ' convert text files (including CSV files) to your current operating system',
29
+ ' environment (e.g., DOS to Unix or Unix to DOS)',
30
+ ' • csv2blank.rb —',
31
+ ' convert CSV files to whitespace-delimited files',
32
+ ' • pool_files.rb —',
33
+ ' pool columns from separate files into a new file, useful for combining',
34
+ ' design file & output files or multiple output files',
35
+ ' • stripheaders.rb , stripheaderdups.rb —',
36
+ ' remove column headers from a file, or duplicate headers within a file,',
37
+ ' respectively',
38
+ '',
39
+ ' #### DESIGN GENERATORS',
40
+ '',
41
+ ' • augment_design.rb —',
42
+ ' generate star points to augment an already existing factorial design',
43
+ ' • cross.rb —',
44
+ ' create a combinatorial design by crossing all combinations of any # of',
45
+ ' individual smaller designs',
46
+ ' • scaled_fde.rb —',
47
+ ' generate fully orthogonal quadratic designs based on discrete Fourier',
48
+ ' frequencies, with factor scaling',
49
+ ' • scaled_rf_cubed.rb —',
50
+ ' generate 2-level Resolution V fractional factorial designs and Central',
51
+ ' Composite Designs (CCDs), with factor scaling',
52
+ ' • stack_nolhs.rb —',
53
+ ' generate designs by reassigning columns from pre-tabled NOLHs, with factor',
54
+ ' scaling, for up to 100 factors',
55
+ '',
56
+ ' #### RUN CONTROL',
57
+ '',
58
+ ' • batchrunner.rb —',
59
+ ' run a model interactively with replication',
60
+ ' • rundesign_general.rb —',
61
+ ' run control to replicate a designed experiment applied to a model',
62
+ '',
63
+ ' #### CONFIDENCE INTERVALS FOR TIME SERIES',
64
+ '',
65
+ ' • mser.rb —',
66
+ ' use MSER truncation to remove initial transient effects for time-series',
67
+ ' output, reporting truncated average and number of observations for each run',
68
+ ' to facilitate construction of a properly weighted confidence interval.',
69
+ ' • mser_nolbm.rb —',
70
+ ' use MSER truncation to remove initial transient effects for time-series',
71
+ ' output, then calculate a 95% confidence interval on the remaining data using',
72
+ ' non-overlapping batch means.',
73
+ ' • mser_olbm.rb —',
74
+ ' use MSER truncation to remove initial transient effects for time-series',
75
+ ' output, then calculate a 95% confidence interval on the remaining data using',
76
+ ' overlapping batch means.',
77
+ ''
78
+ ]
79
+
80
+ lines.each { |line| puts line }
@@ -3,8 +3,8 @@
3
3
  require 'colorize'
4
4
  String.disable_colorization false
5
5
 
6
- require 'datafarming/error_handling'
7
- require 'datafarming/factorial_generator'
6
+ require_relative '../lib/datafarming/error_handling'
7
+ require_relative '../lib/datafarming/factorial_generator'
8
8
 
9
9
  def print_descriptor
10
10
  description = [
@@ -13,43 +13,37 @@ require 'fwt'
13
13
  # corresponds to a factor and each row is a design point.
14
14
  #
15
15
  # Author:: Paul J Sanchez (mailto:pjs@alum.mit.edu)
16
- # Copyright:: Copyright (c) 2018 Paul J Sanchez
16
+ # Copyright:: Copyright (c) 2020 Paul J Sanchez
17
17
  # License:: MIT
18
18
  #
19
- def make_design(number_of_factors)
20
- index = [1, 2, 4, 8, 15, 16, 32, 51, 64, 85, 106, 128, 150, 171,
21
- 219, 237, 247, 256, 279, 297, 455, 512, 537, 557, 594, 643, 803,
22
- 863, 998, 1024, 1051, 1070, 1112, 1169, 1333, 1345, 1620, 1866,
23
- 2048, 2076, 2085, 2185, 2372, 2456, 2618, 2800, 2873, 3127, 3284,
24
- 3483, 3557, 3763, 4096, 4125, 4135, 4174, 4435, 4459, 4469, 4497,
25
- 4752, 5255, 5732, 5804, 5915, 6100, 6369, 6907, 7069, 8192, 8263,
26
- 8351, 8422, 8458, 8571, 8750, 8858, 9124, 9314, 9500, 10_026,
27
- 10_455, 10_556, 11_778, 11_885, 11_984, 13_548, 14_007, 14_514,
28
- 14_965, 15_125, 15_554, 16_384, 16_457, 16_517, 16_609, 16_771,
29
- 16_853, 17_022, 17_453, 17_891, 18_073, 18_562, 18_980, 19_030,
30
- 19_932, 20_075, 20_745, 21_544, 22_633, 23_200, 24_167, 25_700,
31
- 26_360, 26_591, 26_776, 28_443, 28_905, 29_577, 32_705
32
- ]
33
- power = [1, 2, 4, 8, 16, 16, 32, 64, 64, 128, 128, 128, 256, 256,
34
- 256, 256, 256, 256, 512, 512, 512, 512, 1024, 1024, 1024, 1024,
35
- 1024, 1024, 1024, 1024, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
36
- 2048, 2048, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
37
- 4096, 4096, 4096, 4096, 4096, 8192, 8192, 8192, 8192, 8192, 8192,
38
- 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
39
- 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
40
- 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
41
- 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 32_768,
42
- 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
43
- 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
44
- 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
45
- 32_768, 32_768, 32_768
46
- ]
19
+ INDEX = [1, 2, 4, 8, 15, 16, 32, 51, 64, 85, 106, 128, 150, 171,
20
+ 219, 237, 247, 256, 279, 297, 455, 512, 537, 557, 594, 643, 803,
21
+ 863, 998, 1024, 1051, 1070, 1112, 1169, 1333, 1345, 1620, 1866,
22
+ 2048, 2076, 2085, 2185, 2372, 2456, 2618, 2800, 2873, 3127, 3284,
23
+ 3483, 3557, 3763, 4096, 4125, 4135, 4174, 4435, 4459, 4469, 4497,
24
+ 4752, 5255, 5732, 5804, 5915, 6100, 6369, 6907, 7069, 8192, 8263,
25
+ 8351, 8422, 8458, 8571, 8750, 8858, 9124, 9314, 9500, 10_026,
26
+ 10_455, 10_556, 11_778, 11_885, 11_984, 13_548, 14_007, 14_514,
27
+ 14_965, 15_125, 15_554, 16_384, 16_457, 16_517, 16_609, 16_771,
28
+ 16_853, 17_022, 17_453, 17_891, 18_073, 18_562, 18_980, 19_030,
29
+ 19_932, 20_075, 20_745, 21_544, 22_633, 23_200, 24_167, 25_700,
30
+ 26_360, 26_591, 26_776, 28_443, 28_905, 29_577, 32_705]
31
+ POWER = [1, 2, 4, 8, 16, 16, 32, 64, 64, 128, 128, 128, 256, 256,
32
+ 256, 256, 256, 256, 512, 512, 512, 512, 1024, 1024, 1024, 1024,
33
+ 1024, 1024, 1024, 1024, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
34
+ 2048, 2048, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
35
+ 4096, 4096, 4096, 4096, 4096, 8192, 8192, 8192, 8192, 8192, 8192,
36
+ 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
37
+ 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
38
+ 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384,
39
+ 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 16_384, 32_768,
40
+ 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
41
+ 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
42
+ 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768, 32_768,
43
+ 32_768, 32_768, 32_768]
47
44
 
48
- design = Array.new(number_of_factors)
49
- design.each_index do |i|
50
- design[i] = Array.new(power[number_of_factors], 0)
51
- design[i][index[i]] = 1
52
- design[i].hadamard
53
- end
54
- design.transpose
45
+ def make_design(number_of_factors)
46
+ Array.new(number_of_factors) do |i|
47
+ Array.new(POWER[number_of_factors], 0).tap { |a| a[INDEX[i]] = 1 }.hadamard
48
+ end.transpose
55
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datafarming
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul J Sanchez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-17 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fwt
@@ -63,6 +63,7 @@ executables:
63
63
  - convert_line_endings.rb
64
64
  - cross.rb
65
65
  - csv2blank.rb
66
+ - datafarming.rb
66
67
  - moving_average.rb
67
68
  - mser.rb
68
69
  - mser_nolbm.rb
@@ -77,6 +78,8 @@ executables:
77
78
  extensions: []
78
79
  extra_rdoc_files: []
79
80
  files:
81
+ - DESCRIPTIONS.html
82
+ - DESCRIPTIONS.md
80
83
  - LICENSE.md
81
84
  - README.md
82
85
  - datafarming.gemspec
@@ -87,6 +90,7 @@ files:
87
90
  - exe/convert_line_endings.rb
88
91
  - exe/cross.rb
89
92
  - exe/csv2blank.rb
93
+ - exe/datafarming.rb
90
94
  - exe/moving_average.rb
91
95
  - exe/mser.rb
92
96
  - exe/mser_nolbm.rb
@@ -104,11 +108,11 @@ files:
104
108
  - lib/datafarming/freq_sets.rb
105
109
  - lib/datafarming/moving_average.rb
106
110
  - lib/datafarming/nolh_designs.rb
107
- homepage: https://gitlab.nps.edu/pjsanche/datafarmingrubyscripts.git
111
+ homepage: https://bitbucket.org/paul_j_sanchez/datafarmingrubyscripts
108
112
  licenses:
109
113
  - MIT
110
114
  metadata: {}
111
- post_install_message:
115
+ post_install_message:
112
116
  rdoc_options: []
113
117
  require_paths:
114
118
  - lib
@@ -116,16 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
120
  requirements:
117
121
  - - ">="
118
122
  - !ruby/object:Gem::Version
119
- version: '2.3'
123
+ version: '2.5'
120
124
  required_rubygems_version: !ruby/object:Gem::Requirement
121
125
  requirements:
122
126
  - - ">="
123
127
  - !ruby/object:Gem::Version
124
128
  version: '0'
125
129
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.7
128
- signing_key:
130
+ rubygems_version: 3.2.3
131
+ signing_key:
129
132
  specification_version: 4
130
133
  summary: Useful scripts for data farming.
131
134
  test_files: []