unidom-stapar 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dbfcbda29d967437d90d3d8578b33a801600a050ccb72f32ef81e801c2e101ce
4
- data.tar.gz: e93dd8faf4d27b239fd6f4b1d3af472428875aab451b871ff0fd038831a31bc4
3
+ metadata.gz: 98418d2822f1c06426c28b46ad5fcd207f692debb6587a5439d495db2e0145ab
4
+ data.tar.gz: 9b8c23e582da81dc5a6ef76ef11a8c4dde011d7996cf24b865d8d526f8aa0308
5
5
  SHA512:
6
- metadata.gz: 323b9e86fe4c642f7e3c4a58b5582bb772a546116b6f071fa3b6e69b920807e6d8c6b1f11257e3edff3f5d43d101ed426848a4811266558a9a5bc8dd859a5dcc
7
- data.tar.gz: 80d4fd85e3f7a682b423a01d9da92b0814540f0d1d01aafca504c7e1ba35bea5951462ca5819b7be4441cc6011ebdf7956e1d272512fc7f28c477a55611e440b
6
+ metadata.gz: 9dd73bebf75f953d569de601b03fad8fd10820b7fc494caf6c5c2bfa86abe23ee3d7614c86fd428b9a215bdbc15e6d9c68abd99fb4905375b11b4974fcab0e86
7
+ data.tar.gz: cc6b03c87babe6c8d8e0fa738a74fb4633cc593966b9963e3dbbb48dd5353e82c9c5261436fd43b45cc07d6ebc89340c9d958498116cfea3ed72436cdc2b9081
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Gem Version](https://badge.fury.io/rb/unidom-stapar.svg)](https://badge.fury.io/rb/unidom-stapar)
7
7
  [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-stapar.svg)](https://gemnasium.com/github.com/topbitdu/unidom-stapar)
8
8
 
9
- Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Stapar domain model engine includes Sample and Matching models.
9
+ Unidom (UNIfied Domain Object Model) is a series of domain model engines. The StAPaR (Statistical Approach of Pattern Recognition) domain model engine includes Classifier, Sample, Feature, Pattern Library, Pattern Library Inclusion, and Pattern Matching models.
10
10
  Unidom (统一领域对象模型)是一系列的领域模型引擎。统计模式识别领域模型引擎包括采样和匹配的模型。
11
11
 
12
12
 
@@ -14,6 +14,10 @@ module Unidom::Stapar
14
14
  #has_many :pattern_library_inclusions, through: :features
15
15
  #has_many :pattern_libraries, through: :pattern_library_inclusions
16
16
 
17
+ belongs_to :taker_equipment, polymorphic: true
18
+
19
+ scope :taker_equipment_is, -> (taker_equipment) { where taker_equipment: taker_equipment }
20
+
17
21
  end
18
22
 
19
23
  module ClassMethods
@@ -17,7 +17,7 @@ module Unidom::Stapar
17
17
 
18
18
  validates :sampled_at, presence: true
19
19
 
20
- scope :raw_data_link_is, -> (raw_data_link) { where raw_data_link: raw_data_link }
20
+ scope :raw_data_link_is, -> (raw_data_link) { where raw_data_link: raw_data_link }
21
21
 
22
22
  end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Stapar::Sample'
23
23
  end
@@ -4,7 +4,9 @@ class CreateUnidomSamples < ActiveRecord::Migration[6.0]
4
4
 
5
5
  create_table :unidom_samples, id: :uuid do |t|
6
6
 
7
- t.references :substance, type: :uuid, null: false,
7
+ t.references :substance, type: :uuid, null: false,
8
+ polymorphic: { null: false, default: '', limit: 200 }, index: false
9
+ t.references :taker_equipment, type: :uuid, null: false,
8
10
  polymorphic: { null: false, default: '', limit: 200 }, index: false
9
11
 
10
12
  t.string :raw_data_link, null: false, default: '', limit: 200
@@ -21,11 +23,13 @@ class CreateUnidomSamples < ActiveRecord::Migration[6.0]
21
23
  t.boolean :defunct, null: false, default: false
22
24
  t.jsonb :notation, null: false, default: {}
23
25
 
26
+
24
27
  t.timestamps null: false
25
28
 
26
29
  end
27
30
 
28
31
  add_index :unidom_samples, :substance_id
32
+ add_index :unidom_samples, :taker_equipment_id
29
33
 
30
34
  end
31
35
 
@@ -15,14 +15,17 @@ describe Unidom::Stapar::Feature, type: :model do
15
15
  data_format_version: 1,
16
16
  applied_species: 'Homo sapiens',
17
17
  applied_field_code: 'FACE'
18
- substance = classifier
18
+ substance = classifier
19
+ taker_equipment = classifier
19
20
 
20
21
  sample = Unidom::Stapar::Sample.first_or_create! substance_id: substance.id,
21
- substance_type: substance.class.name,
22
- raw_data_link: 'https://objectstore/{id}.jpg',
23
- raw_data_mime_type: 'image/jpeg',
24
- raw_data_file_size: 1.megabytes,
25
- sampled_at: Time.now
22
+ substance_type: substance.class.name,
23
+ taker_equipment_id: taker_equipment.id,
24
+ taker_equipment_type: taker_equipment.class.name,
25
+ raw_data_link: 'https://objectstore/substances/{substance_id}/samples/{id}.jpg',
26
+ raw_data_mime_type: 'image/jpeg',
27
+ raw_data_file_size: 1.megabytes,
28
+ sampled_at: Time.now
26
29
 
27
30
  model_attributes = {
28
31
  sample_id: sample.id,
@@ -15,15 +15,18 @@ describe Unidom::Stapar::Sample, type: :model do
15
15
  data_format_version: 1,
16
16
  applied_species: 'Homo sapiens',
17
17
  applied_field_code: 'FACE'
18
- substance = classifier
18
+ substance = classifier
19
+ taker_equipment = classifier
19
20
 
20
21
  model_attributes = {
21
- substance_id: substance.id,
22
- substance_type: substance.class.name,
23
- raw_data_link: 'https://objectstore/{id}.jpg',
24
- raw_data_mime_type: 'image/jpeg',
25
- raw_data_file_size: 1.megabytes,
26
- sampled_at: Time.now,
22
+ substance_id: substance.id,
23
+ substance_type: substance.class.name,
24
+ taker_equipment_id: taker_equipment.id,
25
+ taker_equipment_type: taker_equipment.class.name,
26
+ raw_data_link: 'https://objectstore/substances/{substance_id}/samples/{id}.jpg',
27
+ raw_data_mime_type: 'image/jpeg',
28
+ raw_data_file_size: 1.megabytes,
29
+ sampled_at: Time.now,
27
30
  }
28
31
 
29
32
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Stapar
3
- VERSION = '0.5'
3
+ VERSION = '0.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-stapar
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -25,8 +25,8 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
28
- The Statistical Approach of Pattern Recognition domain model engine includes Sample
29
- and Matching models. Unidom (统一领域对象模型)是一系列的领域模型引擎。统计模式识别领域模型引擎包括采样和匹配的模型。
28
+ The StAPaR (Statistical Approach of Pattern Recognition) domain model engine includes
29
+ Sample and Matching models. Unidom (统一领域对象模型)是一系列的领域模型引擎。统计模式识别领域模型引擎包括采样和匹配的模型。
30
30
  email:
31
31
  - topbit.du@gmail.com
32
32
  executables: []