File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,10 +119,19 @@ def process_side(side):
119119 normalized_components .append (normalized_component )
120120 return ' + ' .join (sorted (set (normalized_components )))
121121
122- reactants , products = equation .split ('<=>' )
122+ # Handle both reversible (<=>) and irreversible (=>) reactions
123+ if '<=>' in equation :
124+ reactants , products = equation .split ('<=>' )
125+ separator = '<=>'
126+ elif '=>' in equation :
127+ reactants , products = equation .split ('=>' )
128+ separator = '=>'
129+ else :
130+ raise ValueError (f"Unknown reaction format: { equation } " )
131+
123132 normalized_reactants = process_side (reactants )
124133 normalized_products = process_side (products )
125- return f"{ normalized_reactants } <=> { normalized_products } "
134+ return f"{ normalized_reactants } { separator } { normalized_products } "
126135
127136 def compare_reactions (self ):
128137 reactions1 = self .yaml1 .get_reaction_df ()
You can’t perform that action at this time.
0 commit comments