-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: Incorporate "Gas Scheme" feature in reaction variations table #2250
base: main
Are you sure you want to change the base?
Conversation
The example of the reaction variations data structure is unnecessarily verbose and prone to be outdated.
expose :volume, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :yield, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
|
||
expose :duration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Lambda: Use the -> { ... }
lambda literal syntax for single line lambdas.
expose :volume, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :yield, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
|
||
expose :duration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
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. [137/120]
expose :yield, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
|
||
expose :duration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :temperature, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Lambda: Use the -> { ... }
lambda literal syntax for single line lambdas.
expose :yield, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
|
||
expose :duration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :temperature, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
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. [140/120]
|
||
expose :duration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :temperature, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :concentration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Lambda: Use the -> { ... }
lambda literal syntax for single line lambdas.
expose :temperature, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :concentration, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :turnoverNumber, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :turnoverFrequency, if: lambda { |object, _| object[:aux][:gasType] == 'gas' }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
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. [146/120]
expose :amount, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :equivalent, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
|
||
expose :volume, if: lambda { |object, _| (object[:aux][:gasType] == 'feedstock') }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Lambda: Use the -> { ... }
lambda literal syntax for single line lambdas.
expose :amount, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
expose :equivalent, using: 'Entities::ReactionVariationMaterialEntryEntity' | ||
|
||
expose :volume, if: lambda { |object, _| (object[:aux][:gasType] == 'feedstock') }, using: 'Entities::ReactionVariationMaterialEntryEntity' |
There was a problem hiding this comment.
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. [143/120]
@@ -60,23 +60,25 @@ def variations | |||
'startingMaterials' => variation_materials(var, :startingMaterials), | |||
'reactants' => variation_materials(var, :reactants), | |||
'solvents' => variation_materials(var, :solvents), | |||
'products' => variation_products(var), | |||
'products' => variation_materials(var, :products), |
There was a problem hiding this comment.
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. [626/200]
(v[:aux][:isReference] ? '; Ref' : '') | ||
end | ||
end | ||
variation[type].map do |_, vi| |
There was a problem hiding this comment.
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 variation_materials is too high. [8/7]
LCOV of commit
|
This PR addresses #2213.
See also https://docs.google.com/document/d/1Jd6V5zqRv0cfw_xAJE-oHDYzSuBMQyBBz3wQQBxRGJo/edit and https://www.chemotion.net/docs/eln/ui/elements/reactions?_highlight=gas#gas-phase-reaction-scheme.