Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion rate rebased to v1.9.3 #2242

Open
wants to merge 1 commit into
base: v1.9
Choose a base branch
from

Conversation

adambasha0
Copy link
Contributor

@adambasha0 adambasha0 commented Nov 18, 2024

  • rather 1-story 1-commit than sub-atomic commits

  • commit title is meaningful => git history search

  • commit description is helpful => helps the reviewer to understand the changes

  • code is up-to-date with the latest developments of the target branch (rebased to it or whatever) => ⏩-merge for linear history is favoured

  • added code is linted

  • tests are passing (at least locally): we still have some random test failure on CI. thinking of asking spec/examples.txt to be commited

  • in case the changes are visible to the end-user,  video or screenshots should be added to the PR => helps with user testing

  • testing coverage improvement is improved.

  • CHANGELOG :  add a bullet point on top (optional: reference to github issue/PR )

  • parallele PR for documentation  on docusaurus  if the feature/fix is tagged for a release

@@ -614,6 +614,7 @@ def build_sql_reaction_sample(columns, c_id, ids, checkedAll = false)
# reactions_sample:
equivalent: ['r_s.equivalent', '"r eq"', 10],
reference: ['r_s.reference', '"r ref"', 10],
conversion_rate: ['r_s.conversion_rate', '"r conversion rate"', 10],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/ModuleLength: Module has too many lines. [611/100]

@@ -111,7 +111,7 @@ def create_new_sample(sample, fixed_label)
:id, :is_new, :is_split, :reference, :equivalent, :position,
:type, :molecule, :collection_id, :short_label, :waste, :show_label, :coefficient, :user_labels,
:boiling_point_lowerbound, :boiling_point_upperbound,
:melting_point_lowerbound, :melting_point_upperbound, :segments
:melting_point_lowerbound, :melting_point_upperbound, :segments, :conversion_rate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/AbcSize: Assignment Branch Condition size for create_new_sample is too high. [<7, 30, 4> 31.06/25]

@@ -82,6 +82,7 @@ class Import::ImportJson
# 'r_uuid' => nil,
# 'r_reference' => nil,
# 'r_equivalent' => nil,
# 'r_conversion_rate' => nil,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/ClassLength: Class has too many lines. [284/200]

@@ -374,7 +375,8 @@ def add_to_reaction(klass, el, new_el)
if new_data && new_data[r_uuid] && new_data[r_uuid]['id']
@log['samples'][el_uuid][klass.name] = klass.create(
sample_id: new_el.id, reaction_id: new_data[r_uuid]['id'],
reference: ref, equivalent: eq, position: el['r_position']
reference: ref, equivalent: eq, position: el['r_position'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/AbcSize: Assignment Branch Condition size for add_to_reaction is too high. [<6, 26, 9> 28.16/25]

@@ -374,7 +375,8 @@ def add_to_reaction(klass, el, new_el)
if new_data && new_data[r_uuid] && new_data[r_uuid]['id']
@log['samples'][el_uuid][klass.name] = klass.create(
sample_id: new_el.id, reaction_id: new_data[r_uuid]['id'],
reference: ref, equivalent: eq, position: el['r_position']
reference: ref, equivalent: eq, position: el['r_position'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.

@@ -374,7 +375,8 @@ def add_to_reaction(klass, el, new_el)
if new_data && new_data[r_uuid] && new_data[r_uuid]['id']
@log['samples'][el_uuid][klass.name] = klass.create(
sample_id: new_el.id, reaction_id: new_data[r_uuid]['id'],
reference: ref, equivalent: eq, position: el['r_position']
reference: ref, equivalent: eq, position: el['r_position'],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.

@@ -333,7 +333,7 @@ def material_hash(material, is_product=false)
mol: valid_digit(mmol, digit),
mmol_unit: mmol_unit,
equiv: valid_digit(s.equivalent, digit),
molecule_name_hash: s[:molecule_name_hash]
molecule_name_hash: s[:molecule_name_hash],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/ClassLength: Class has too many lines. [606/200]

@@ -333,7 +333,7 @@ def material_hash(material, is_product=false)
mol: valid_digit(mmol, digit),
mmol_unit: mmol_unit,
equiv: valid_digit(s.equivalent, digit),
molecule_name_hash: s[:molecule_name_hash]
molecule_name_hash: s[:molecule_name_hash],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/AbcSize: Assignment Branch Condition size for material_hash is too high. [<10, 51, 7> 52.44/25]

@@ -333,7 +333,7 @@ def material_hash(material, is_product=false)
mol: valid_digit(mmol, digit),
mmol_unit: mmol_unit,
equiv: valid_digit(s.equivalent, digit),
molecule_name_hash: s[:molecule_name_hash]
molecule_name_hash: s[:molecule_name_hash],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/CyclomaticComplexity: Cyclomatic complexity for material_hash is too high. [8/7]

@@ -333,7 +333,7 @@ def material_hash(material, is_product=false)
mol: valid_digit(mmol, digit),
mmol_unit: mmol_unit,
equiv: valid_digit(s.equivalent, digit),
molecule_name_hash: s[:molecule_name_hash]
molecule_name_hash: s[:molecule_name_hash],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/MethodLength: Method has too many lines. [32/30]

@adambasha0 adambasha0 force-pushed the conversion-rate-rebased-to-v1.9.3 branch 2 times, most recently from 2bd68f2 to 6adfa08 Compare November 18, 2024 15:26
@adambasha0 adambasha0 self-assigned this Nov 19, 2024
@PiTrem PiTrem force-pushed the conversion-rate-rebased-to-v1.9.3 branch from 6adfa08 to bd5f05f Compare November 20, 2024 08:58
ElementPermissionProxy.new(current_user, element, user_ids).read_dataset?)

if !can_dwnld && (element = @attachment.container&.root&.containable || @attachment.attachable)
can_dwnld = if element.is_a?(Container)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/BlockNesting: Avoid more than 3 levels of block nesting.

@message = content_path.read
@output = markdown(@message)

mail(to: @user.email, subject: '[ELN] Welcome to Chemotion.')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/I18nLocaleTexts: Move locale texts to the locale files in the config/locales directory.

@@ -20,8 +20,7 @@
# updated_at :datetime not null
# template :string default("standard")
# mol_serials :text default([])
# si_reaction_settings :text default({"Name"=>true, "CAS"=>true, "Formula"=>true, "Smiles"=>true,
# "InCHI"=>true, "Molecular Mass"=>true, "Exact Mass"=>true, "EA"=>true})
# si_reaction_settings :text default({"Name"=>true, "CAS"=>true, "Formula"=>true, "Smiles"=>true, "InCHI"=>true, "Molecular Mass"=>true, "Exact Mass"=>true, "EA"=>true})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/LineLength: Line is too long. [182/120]

end
self.profile.update_columns(data: data)
def profile
super || (new_record? && build_profile ) || create_profile

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideParens: Space inside parentheses detected.

@@ -333,7 +333,7 @@ def material_hash(material, is_product=false)
mol: valid_digit(mmol, digit),
mmol_unit: mmol_unit,
equiv: valid_digit(s.equivalent, digit),
molecule_name_hash: s[:molecule_name_hash]
molecule_name_hash: s[:molecule_name_hash],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/ClassLength: Class has too many lines. [605/200]

@@ -423,7 +479,7 @@
end

describe 'POST /api/v1/attachments/thumbnails' do
pending 'not yet implemented'
pending

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/PendingWithoutReason: Give the reason for pending.

@PiTrem PiTrem force-pushed the conversion-rate-rebased-to-v1.9.3 branch from bd5f05f to e4330d7 Compare November 20, 2024 13:29
@PiTrem PiTrem changed the base branch from branch-from-v1.9.3 to v1.9 December 5, 2024 08:29
@adambasha0 adambasha0 force-pushed the conversion-rate-rebased-to-v1.9.3 branch from e4330d7 to c629eb6 Compare December 18, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant