-
Notifications
You must be signed in to change notification settings - Fork 7
Simplify xmi to liquid #136
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
Conversation
@@ -16,7 +16,7 @@ | |||
end | |||
|
|||
it "correctly reads schema attributes" do | |||
expect(parse.schemas.first.id).to(eq('annotated_3d_model_data_quality_criteria_schema')) | |||
expect(parse.schemas.first.id).to(eq("annotated_3d_model_data_quality_criteria_schema")) |
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.
Line is too long. [96/80]
# @param link [Lutaml::Model::Serializable] | ||
# @param link_member_name [String] | ||
# @return [Array<String, String, Hash, String, String>] | ||
def serialize_member_type(owner_xmi_id, link, link_member_name) |
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.
Method has too many lines. [11/10]
|
||
# @param general_id [String] | ||
# @return [Array<Hash>] | ||
def get_general_hash(general_id) |
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.
Method has too many lines. [15/10]
return nil | ||
end | ||
end | ||
def initialize |
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.
Call super to initialize state of the parent class.
module Lutaml | ||
module SysMl | ||
class ConstraintBlock < Block | ||
def initialize |
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.
Call super to initialize state of the parent class.
def initialize | ||
@property_path = [] | ||
end | ||
def initialize |
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.
Call super to initialize state of the parent class.
end | ||
|
||
if (["uml:Property", "uml:Port"].include?(xml_node.attribute_with_ns("type", | ||
xmiNS.href).to_s)) && not ["definingFeature", "partWithPort", "propertyPath", |
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.
unexpected token tLBRACK
path_to_file = File.join(include_root, | ||
path_to_file) | ||
end | ||
File.read(path_to_file).split("\n").map do |line| |
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.
Shadowing outer local variable - line.
Hi @ronaldtse, Please do not merge this PR at this moment as I found some strange performance problem and bugs. For performance problem, the time for running all HOWEVER, if I run the specs of Moreover, when I ran the specs of |
For NEW and OLD lutaml, can you determine versions they are? This will be helpful for @HassanAkbar in profiling/debugging. Thanks! |
OLD lutaml means NEW lutaml means the changes in the branch |
Actually, it's possible that the |
I found the area in |
def initialize(model) # rubocop:disable Lint/MissingSuper | ||
@model = model | ||
end | ||
|
||
def min | ||
@model[:min] | ||
return @model[:min] if @model.is_a?(Hash) |
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.
Is this for compatibility with the old approach?
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.
No, it is not for compatibility.
def initialize(model) # rubocop:disable Lint/MissingSuper | ||
@model = model | ||
end | ||
|
||
def name | ||
@model[:name] | ||
HTMLEntities.new.decode(@model.name) |
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.
We should move this to the xmi
gem?
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.
@kwkwan can we move this to the xmi
gem?
# @param with_absolute_path: [Boolean] | ||
# @return [Hash] | ||
# @note xpath: //uml:Model[@xmi:type="uml:Model"] | ||
def serialize_to_hash(xmi_model, |
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.
Very nice!!
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.
Just a few questions.
The bugs causing The performance issue still exists. The time for running specs in |
@kwkwan can you use a ruby profiler to find out where it is being slow? |
Will have a try. |
The commit bdf06fc caches the id name mapping properly. The performance has been improved. The time to run all specs in The time to run specs of |
No description provided.