Bug in CommonRoadFileReader Class

I found an minor bug in Commonroad-io. https://commonroad-io.readthedocs.io/en/latest/_modules/commonroad/common/file_reader/?highlight=_get_tags#
def _get_tags(self) -> Set[Tag]: """ Reads the tags of the scenario.""" tags_string = self._tree.getroot().get('tags') splits = tags_string.split()

Some files do not have any tags (e.g. the case for some inD). If xmlroot/tags is not set (empty), tags_split == None. None.split() then throws an error.

Proposal:
It should check for None and return an empty set instead.

Hi Michael,

this is no real bug within commonroad-io since the tag is a mandatory element in the scenario XML.
We will update the dataset converter so that scenarios created from the inD dataset contain valid tags.

Best,
Sebastian

I think the scenarios files acctually do look okay. is there an issue because of self._tree.getroot().get('tags') instead of self._tree.getroot().get('scenarioTags')

<?xml version='1.0' encoding='UTF-8'?>

<commonRoad timeStepSize="0.04" commonRoadVersion="2020a" author="Niels Mündler, Xiao Wang" affiliation="Technical University of Munich, Germany" source="The Intersection Drone Dataset (inD)" benchmarkID="DEU_AAH-1_7012_T-1" date="2021-05-19">
  <location>
    <geoNameId>-999</geoNameId>
    <gpsLatitude>999</gpsLatitude>
    <gpsLongitude>999</gpsLongitude>
  </location>
  <scenarioTags>
    <multi_lane/>
    <speed_limit/>
    <urban/>
    <intersection/>
    <oncoming_traffic/>
  </scenarioTags>
  <lanelet id="100">

2018b scenarios contained the tag inside the header. This changed with the 2020a version where scenarioTags was added to the xml main part. Therefore, the old tag should only be evaluated for the 2018b scenarios which is checked here.