uc3-dmp-id 0.1.5 → 0.1.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: 2b097e9c732ee345e066017667d9db005ead650773c2a531dad7fe8eccb5031d
4
- data.tar.gz: 4e0134ebceda7abd03b59dcfc354faa7da70b1159e5a795d99a248288dff3f1c
3
+ metadata.gz: ed142333899fd7e57c9dc8c5052b51205b13494bb513b2199583397eef7162c7
4
+ data.tar.gz: 01cd7806f0900434cec2a2c5e43488fd9da112e1521e44914a81a51c2a5d7742
5
5
  SHA512:
6
- metadata.gz: 3fc6e478d5c3adf03086254de328df4f84836adbc7682827d9a1ea2df185ad626e8996685ddfc1a86130e3827a08fa2a9101256ab4dc60f9834533156202b478
7
- data.tar.gz: 9a43c72bc52d91dcd85c20bb4ec76f45518b7e7ce691ee7320f52d1b2d45dec9b21d0112aeca90db74e9dc644d521671b5ff6ae9f0dccee966745504fefe1904
6
+ metadata.gz: 102d4e2cafbf9594f6a69d195e9c2659f34e19505bded960979ce24901d144d07d0851b92a6d94a979b87e081a984d3c4999e0933cb667014b38c95fdd781495
7
+ data.tar.gz: 5301292abe35dcaf79c1ae053d5035a057986a671442f4e0d06087441373b607256de5c951603be764f857ef273643bbd17ee6fa42179d9f7b6ef6ea49033755
@@ -17,17 +17,13 @@ module Uc3DmpId
17
17
  # See the bottom of this file for a hard-coded crosswalk between Crossref funder ids and ROR ids
18
18
  # Some APIs do not support ROR fully for funder ids, so we need to be able to reference both
19
19
 
20
- attr_accessor :augmenter, :dmp, :details_hash, :logger
20
+ attr_accessor :dmp, :details_hash, :logger
21
21
 
22
22
  # rubocop:disable Metrics/AbcSize
23
23
  def initialize(**args)
24
24
  @logger = args[:logger]
25
25
  @details_hash = {}
26
26
 
27
- @augmenter = args[:augmenter]
28
- raise ComparatorError, MSG_MISSING_AUGMENTER if @augmenter.nil? ||
29
- !@augmenter['PK']&.start_with?('AUGMENTERS#')
30
-
31
27
  @dmp = args.fetch(:dmp, {})['dmp'].nil? ? args[:dmp] : args.fetch(:dmp, {})['dmp']
32
28
  _extract_dmp_details(dmp:)
33
29
  raise ComparatorError, MSG_MISSING_DMP if @details_hash.empty?
@@ -57,7 +53,7 @@ module Uc3DmpId
57
53
  # }
58
54
  # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
59
55
  def compare(hash:)
60
- response = { confidence: 'None', score: 0, notes: [], source: @augmenter['name'] }
56
+ response = { confidence: 'None', score: 0, notes: [] }
61
57
  return response unless hash.is_a?(Hash) && !hash['title'].nil?
62
58
 
63
59
  # Compare the grant ids. If we have a match return the response immediately since that is
@@ -78,10 +74,10 @@ module Uc3DmpId
78
74
  return response if response[:score] <= 2
79
75
 
80
76
  # Set the confidence level based on the score
81
- response[:confidence] = if response[:score] > 15
77
+ response[:confidence] = if response[:score] > 10
82
78
  'High'
83
79
  else
84
- (response[:score] > 10 ? 'Medium' : 'Low')
80
+ (response[:score] > 5 ? 'Medium' : 'Low')
85
81
  end
86
82
  response
87
83
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-26 00:00:00.000000000 Z
11
+ date: 2023-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json