Skip to content

Conversation

syntron
Copy link
Contributor

@syntron syntron commented Apr 25, 2025

Simplify ModelicaSystem:

  • remove variables in xmlparse()
  • raise ModelicaSystemException if there is an invalid input type
  • do not try to continue in getSolution() but fail with ModelicaSytemException
  • remove redundant parenthese

@syntron syntron force-pushed the fix_ModelicaSystem branch 2 times, most recently from 2927d51 to d12e0a3 Compare April 25, 2025 21:09
syntron added 4 commits April 29, 2025 18:53
…ases

there are a lot of functions which check the type of the input; this is
done by if ... elif ... - however, invalid input is not catched, i.e. there
is *NO* return value define (would be None) if the input is not matching
any of the if branches
Rule: fail early, fail hard - tell the user that something is wrong!

In this case, the user ask for the solution but could get None (= plain
'return') - this would case hard to track errors later (if verbose==False
and raiseerrors==False)
@syntron syntron force-pushed the fix_ModelicaSystem branch from d12e0a3 to d066548 Compare April 29, 2025 18:56
@arun3688 arun3688 merged commit cb657cf into OpenModelica:master Apr 29, 2025
5 checks passed
@syntron syntron deleted the fix_ModelicaSystem branch April 29, 2025 20:46
@syntron syntron mentioned this pull request May 1, 2025
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.

2 participants