labimotion 1.4.0 → 1.4.1
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 +4 -4
- data/lib/labimotion/apis/converter_api.rb +2 -2
- data/lib/labimotion/libs/converter.rb +5 -3
- data/lib/labimotion/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1c30f358902beeb863766ddb2ee02b980b3cca7055f45babe20fb4211277772
|
4
|
+
data.tar.gz: 86e1e46884b26fbfff1a91618698ab29072940109f9bc7c3d114b48a9b93ee86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41655a864b15b848116b370964ae6a05c707512d6ba80987cdec1f392d3fb647476fcf119612f116a2923c4992e32b00127371ac8a77d6e7de6cf1dc94773dbd
|
7
|
+
data.tar.gz: 8308707ad72ac2ebd38c725bc1336151712b5900fa4f35429674ee54f26cbe6fcc7ed43ef71777b6dd069701411540c776a7f183b183d147c1a3658a124e12a7
|
@@ -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
|
@@ -125,7 +125,7 @@ module Labimotion
|
|
125
125
|
|
126
126
|
name = response&.headers && response&.headers['content-disposition']&.split('=')&.last
|
127
127
|
filename = oat.filename
|
128
|
-
name = "#{File.basename(filename, '.*')}.zip"
|
128
|
+
name = "#{File.basename(filename, '.*')}.zip"
|
129
129
|
|
130
130
|
att = Attachment.new(
|
131
131
|
filename: name,
|
@@ -172,7 +172,7 @@ module Labimotion
|
|
172
172
|
Labimotion::ConState::ERROR
|
173
173
|
end
|
174
174
|
rescue StandardError => e
|
175
|
-
Labimotion::Converter.logger.error ["process fail: #{id}", e.message, *e.backtrace].join($INPUT_RECORD_SEPARATOR)
|
175
|
+
Labimotion::Converter.logger.error ["process fail: [#{data[:a]&.id}]", e.message, *e.backtrace].join($INPUT_RECORD_SEPARATOR)
|
176
176
|
Labimotion::ConState::ERROR
|
177
177
|
ensure
|
178
178
|
FileUtils.rm_f(ofile)
|
@@ -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.
|
4
|
+
version: 1.4.1
|
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-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|