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

#2412 - User can't correctly save (or make a layout) to RDF/RXN reaction several products or with separate positioned molecules #2717

Merged
merged 114 commits into from
Feb 18, 2025

Conversation

even1024
Copy link
Collaborator

Generic request

  • PR name follows the pattern #1234 – issue name
  • branch name does not contain '#'
  • base branch (master or release/xx) is correct
  • PR is linked with the issue
  • task status changed to "Code review"
  • code follows product standards
  • regression tests updated

@even1024 even1024 marked this pull request as ready for review January 9, 2025 11:28
{
for (auto& section : cz.second)
{
if ((_zones[cz.first].zone_type == ZoneType::EPathWay && section > 1) || it_oz2->second.count(section ^ 1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not clear what means it_oz2->second.count(section ^ 1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added clarifying comment

Copy link
Collaborator

@AliaksandrDziarkach AliaksandrDziarkach Feb 17, 2025

Choose a reason for hiding this comment

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

According to findMaxSpecialZone zone1, zone2 and comm_zone are std::map<int, std::set<int>> where key is index in _zones and std::set<int> is indexes of sections from this zone which intersect with molecule.
So, it's works only why sections inserted into zones in current order(I'm not sure about pathway zone which has one right zone and from 0 to n left zones)
If later section adding will be changed - this part of code broke.
Same in lines 824-825:

                            auto& top_zone = _zones[reaction_index].zone_sections[2];
                            auto& bottom_zone = _zones[reaction_index].zone_sections[3];

Maybe better define sections explicitly?


float min_distance_h = 0, min_distance_v = 0;

bool result = false;

if (rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end())
if (rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end() && lefts_row_it->second != rights_row_it->second)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if one molecule bbox contains plus? Other molecules not checked?
maybe better before if do
while(rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end() && lefts_row_it->second == rights_row_it->second){ lefts_row_it++; rights_row_it ++; }
and if change to if (rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end())

connection.second = lefts_row_it->second;
connection.first = rights_row_it->second;
result = _reaction_components[connection.first].component_type == ReactionComponent::MOLECULE &&
_reaction_components[connection.second].component_type == ReactionComponent::MOLECULE;
}

if (tops_col_it != tops_col.end() && bottoms_col_it != bottoms_col.end())
if (tops_col_it != tops_col.end() && bottoms_col_it != bottoms_col.end() && tops_col_it->second != bottoms_col_it->second)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

@AlexanderSavelyev AlexanderSavelyev merged commit 9132b83 into master Feb 18, 2025
74 checks passed
@AlexanderSavelyev AlexanderSavelyev deleted the 2412-reaction-merges branch February 18, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants