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 +4 -4
- data/README.md +1 -1
- data/app/models/unidom/stapar/concerns/as_sample.rb +4 -0
- data/app/models/unidom/stapar/sample.rb +1 -1
- data/db/migrate/20060103000000_create_unidom_samples.rb +5 -1
- data/lib/rspec/models/unidom/stapar/feature_spec.rb +9 -6
- data/lib/rspec/models/unidom/stapar/sample_spec.rb +10 -7
- data/lib/unidom/stapar/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98418d2822f1c06426c28b46ad5fcd207f692debb6587a5439d495db2e0145ab
|
4
|
+
data.tar.gz: 9b8c23e582da81dc5a6ef76ef11a8c4dde011d7996cf24b865d8d526f8aa0308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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,
|
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,
|
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
|
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:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
18
|
+
substance = classifier
|
19
|
+
taker_equipment = classifier
|
19
20
|
|
20
21
|
model_attributes = {
|
21
|
-
substance_id:
|
22
|
-
substance_type:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
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.
|
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-
|
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
|
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: []
|