labimotion 1.4.0 → 1.4.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5564b71b1b531e05ab523719dbd1a052c19828c86921f17381ca545554f2c514
|
4
|
+
data.tar.gz: ee3b1e84d1aff2619a9ab65901c0f6c20af7288b3b6ef6f7ec49843dd78a543e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8cfa29e6fbc0ed90c8bec7e581286f2921c461c0ba8fd9b957d98cd88287630f46fe86ab7f86404afd4379623e66296e23e858746b050b66ad76f3290799792
|
7
|
+
data.tar.gz: af817bdab6d263afbb26b9efb7313ab505d3b56727e97b7c31149f139bfe6c45b26650ebcabc4614a4e367ff10f6719ffbedb6b9c5acae580c301a50c5379f15
|
@@ -39,11 +39,11 @@ module Labimotion
|
|
39
39
|
helpers do
|
40
40
|
def convert_structure(molfile)
|
41
41
|
molecule_viewer = Matrice.molecule_viewer
|
42
|
-
if molecule_viewer.blank? || molecule_viewer[:
|
42
|
+
if molecule_viewer.blank? || molecule_viewer[:chembox].blank?
|
43
43
|
{ molfile: molfile }
|
44
44
|
else
|
45
45
|
options = { timeout: 10, body: { mol: molfile }.to_json, headers: { 'Content-Type' => 'application/json' } }
|
46
|
-
response = HTTParty.post("#{molecule_viewer[:
|
46
|
+
response = HTTParty.post("#{molecule_viewer[:chembox]}/core/rdkit/v1/structure", options)
|
47
47
|
if response.code == 200
|
48
48
|
{ molfile: (response.parsed_response && response.parsed_response['molfile']) || molfile }
|
49
49
|
else
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# app/api/labimotion/central_api.rb
|
2
|
+
module Labimotion
|
3
|
+
class LabimotionAPI < Grape::API
|
4
|
+
mount Labimotion::ConverterAPI
|
5
|
+
mount Labimotion::GenericKlassAPI
|
6
|
+
mount Labimotion::GenericElementAPI
|
7
|
+
mount Labimotion::GenericDatasetAPI
|
8
|
+
mount Labimotion::SegmentAPI
|
9
|
+
mount Labimotion::LabimotionHubAPI
|
10
|
+
mount Labimotion::StandardLayerAPI
|
11
|
+
mount Labimotion::VocabularyAPI
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'labimotion/version'
|
4
|
+
|
5
|
+
module Labimotion
|
6
|
+
# Generic Element API
|
7
|
+
class VocabularyAPI < Grape::API
|
8
|
+
include Grape::Kaminari
|
9
|
+
helpers Labimotion::ParamHelpers
|
10
|
+
|
11
|
+
resource :vocab do
|
12
|
+
namespace :save do
|
13
|
+
desc 'Save vocabularies'
|
14
|
+
params do
|
15
|
+
use :std_layer_save
|
16
|
+
end
|
17
|
+
before do
|
18
|
+
rescue ActiveRecord::RecordNotFound
|
19
|
+
error!('404 Not Found', 404)
|
20
|
+
end
|
21
|
+
post do
|
22
|
+
rescue ActiveRecord::RecordInvalid => e
|
23
|
+
{ error: e.message }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
namespace :field_klasses do
|
28
|
+
desc 'get all field klasses for admin function'
|
29
|
+
get do
|
30
|
+
list = Labimotion::Vocabulary.all.sort_by { |e| e.name }
|
31
|
+
present list, with: Labimotion::VocabularyEntity, root: 'klass'
|
32
|
+
rescue StandardError => e
|
33
|
+
Labimotion.log_exception(e, current_user)
|
34
|
+
[]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -232,10 +232,12 @@ module Labimotion
|
|
232
232
|
new_prop = dataset.properties
|
233
233
|
dsr.each do |ds|
|
234
234
|
layer = layers[ds[:layer]]
|
235
|
-
next if layer.
|
235
|
+
next if layer.blank? || layer[Labimotion::Prop::FIELDS].blank?
|
236
236
|
|
237
237
|
fields = layer[Labimotion::Prop::FIELDS].select{ |f| f['field'] == ds[:field] }
|
238
238
|
fi = fields&.first
|
239
|
+
next if fi.blank?
|
240
|
+
|
239
241
|
idx = layer[Labimotion::Prop::FIELDS].find_index(fi)
|
240
242
|
fi['value'] = ds[:value]
|
241
243
|
fi['device'] = ds[:device] || ds[:value]
|
data/lib/labimotion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: labimotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0
|
4
|
+
version: 1.4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chia-Lin Lin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -38,8 +38,10 @@ files:
|
|
38
38
|
- lib/labimotion/apis/generic_dataset_api.rb
|
39
39
|
- lib/labimotion/apis/generic_element_api.rb
|
40
40
|
- lib/labimotion/apis/generic_klass_api.rb
|
41
|
+
- lib/labimotion/apis/labimotion_api.rb
|
41
42
|
- lib/labimotion/apis/labimotion_hub_api.rb
|
42
43
|
- lib/labimotion/apis/segment_api.rb
|
44
|
+
- lib/labimotion/apis/vocabulary_api.rb
|
43
45
|
- lib/labimotion/collection/export.rb
|
44
46
|
- lib/labimotion/collection/import.rb
|
45
47
|
- lib/labimotion/conf.rb
|