@@ -807,26 +807,17 @@ def upgrade_convention(self, target=None, verify='auto'):
807807
808808 # check input ---------------------------------------------------------
809809 self ._reset_convention ()
810+ status = self .convention_status
810811
811812 # get deprecations and information about Sofa object
812- _ , _ , deprecations , upgrade = self ._verification_rules ()
813+ _ , _ , _ , upgrade = self ._verification_rules ()
813814 convention_current = self .GLOBAL_SOFAConventions
814815 version_current = self .GLOBAL_SOFAConventionsVersion
815816 sofa_version_current = self .GLOBAL_Version
816817
817- # check if convention is deprecated -----------------------------------
818- is_deprecated = False
819-
820- if convention_current in deprecations ["GLOBAL:SOFAConventions" ]:
821- is_deprecated = True
822- elif convention_current in upgrade :
823- for from_to in upgrade [convention_current ]["from_to" ]:
824- if version_current in from_to [0 ]:
825- is_deprecated = True
826- break
827-
828818 # check for upgrades --------------------------------------------------
829- if is_deprecated :
819+ if status == 'deprecated' :
820+
830821 # check if upgrade is available for this convention
831822 if convention_current not in upgrade :
832823 print ((f"Convention { convention_current } v{ version_current } is"
@@ -1027,6 +1018,7 @@ def verify(self, issue_handling="raise", mode="write"):
10271018 # ---------------------------------------------------------------------
10281019 # 0. update the convention
10291020 self ._reset_convention ()
1021+ status = self .convention_status
10301022
10311023 # ---------------------------------------------------------------------
10321024 # 1. check if the mandatory attributes are contained
@@ -1437,21 +1429,18 @@ def verify(self, issue_handling="raise", mode="write"):
14371429 # ---------------------------------------------------------------------
14381430 # 8. check deprecations
14391431 # (so far there are only deprecations for the convention)
1440- if self .GLOBAL_SOFAConventions in \
1441- deprecations ["GLOBAL:SOFAConventions" ]:
1442- convention = self .GLOBAL_SOFAConventions
1432+ if status == 'deprecated' :
14431433 msg = ("Detected deprecations:\n "
14441434 f"- GLOBAL_SOFAConventions is "
1445- f"{ self .GLOBAL_SOFAConventions } , which is deprecated. Use "
1446- "Sofa.upgrade_convention() to upgrade to "
1447- f"{ deprecations ['GLOBAL:SOFAConventions' ][convention ]} " )
1435+ f"{ self .GLOBAL_SOFAConventions } , which is deprecated. See "
1436+ "Sofa.upgrade_convention() for upgrade possibilities." )
14481437 if mode == "write" :
14491438 error_msg += msg
14501439 else :
14511440 warning_msg += msg
14521441
14531442 # warn if preliminary conventions versions are used
1454- if float ( self . GLOBAL_SOFAConventionsVersion ) < 1.0 :
1443+ if status == 'preliminary' :
14551444 warning_msg += (
14561445 "\n \n Detected preliminary conventions version "
14571446 f"{ self .GLOBAL_SOFAConventionsVersion } :\n - Upgrade data to "
0 commit comments