File tree Expand file tree Collapse file tree
mpcontribs-client/mpcontribs/client
mpcontribs-portal/mpcontribs/portal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1536,20 +1536,23 @@ def init_columns(
15361536 new_unit = new_column .get ("unit" , "NaN" )
15371537 existing_unit = existing_column .get ("unit" )
15381538 if existing_unit != new_unit :
1539- conv_args = []
1540- for u in [existing_unit , new_unit ]:
1539+ if existing_unit == "NaN" and new_unit == "" :
1540+ factor = 1
1541+ else :
1542+ conv_args = []
1543+ for u in [existing_unit , new_unit ]:
1544+ try :
1545+ conv_args .append (ureg .Unit (u ))
1546+ except ValueError :
1547+ raise MPContribsClientError (
1548+ f"Can't convert { existing_unit } to { new_unit } for { path } "
1549+ )
15411550 try :
1542- conv_args . append ( ureg .Unit ( u ) )
1543- except ValueError :
1551+ factor = ureg .convert ( 1 , * conv_args )
1552+ except DimensionalityError :
15441553 raise MPContribsClientError (
15451554 f"Can't convert { existing_unit } to { new_unit } for { path } "
15461555 )
1547- try :
1548- factor = ureg .convert (1 , * conv_args )
1549- except DimensionalityError :
1550- raise MPContribsClientError (
1551- f"Can't convert { existing_unit } to { new_unit } for { path } "
1552- )
15531556
15541557 if not isclose (factor , 1 ):
15551558 logger .info (
Original file line number Diff line number Diff line change 1+ """Set version for mpcontribs-io."""
2+
3+ from importlib .metadata import version
4+
5+ try :
6+ __version__ = version ("mpcontribs-io" )
7+ except Exception :
8+ # package is not installed
9+ pass
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ include-package-data = true
1212[tool .setuptools .packages .find ]
1313where = [" ." ]
1414exclude = [" scripts" ," supervisord" ]
15- include = [" mpcontribs.io.core " , " mpcontribs.io.archie " ]
15+ include = [" mpcontribs.io" ]
1616
1717[project ]
1818name = " mpcontribs-io"
Original file line number Diff line number Diff line change 1+ """Set version for mpcontribs-portal."""
2+
3+ from importlib .metadata import version
4+
5+ try :
6+ __version__ = version ("mpcontribs-portal" )
7+ except Exception :
8+ # package is not installed
9+ pass
You can’t perform that action at this time.
0 commit comments