Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The example does not work #3

Open
SaturnHafen opened this issue Jan 19, 2023 · 4 comments
Open

The example does not work #3

SaturnHafen opened this issue Jan 19, 2023 · 4 comments

Comments

@SaturnHafen
Copy link
Contributor

When trying to run the example, the program crashes with an AtributeError.

Stack trace:

saturnhafen@pop-os:~/Code/Bachelorprojekt/yaramo-testing/sumo-exporter/examples$ poetry run python example.py 
--------------------------------------------------
----- Warnings -- count: 3 -----
Warning: Value "Notstromaggregat_NEA_stationaer" near line 50 does not match xsd enumeration restriction on ENUMEV_Art
Warning: Value "1" does not match xsd pattern restrictions: [['^([0-9]{2})$']]
Warning: Value "4" does not match xsd pattern restrictions: [['^([0-9]{2})$']]
--------------------------------------------------
Traceback (most recent call last):
  File "/home/saturnhafen/Code/Bachelorprojekt/yaramo-testing/sumo-exporter/examples/example.py", line 12, in <module>
    sumo_exporter.convert()
  File "/home/saturnhafen/Code/Bachelorprojekt/yaramo-testing/sumo-exporter/sumoexporter/sumoexporter.py", line 19, in convert
    self.convert_topology()
  File "/home/saturnhafen/Code/Bachelorprojekt/yaramo-testing/sumo-exporter/sumoexporter/sumoexporter.py", line 26, in convert_topology
    point_obj = Point(yaramo_node.uuid, yaramo_node.geo_node.uuid)
AttributeError: 'NoneType' object has no attribute 'uuid'
@SaturnHafen SaturnHafen changed the title The example seems broken :( The example does not work Jan 19, 2023
@SaturnHafen
Copy link
Contributor Author

I think the problem is that we just create Nodes without any reference to geo_nodes: https://github.com/simulate-digital-rail/planpro-importer/blob/main/planpro_importer/reader.py#L29-L32

When comparing to the ORM-Importer, it seems like GeoNodes are manually created there: https://github.com/simulate-digital-rail/orm-importer/blob/main/orm_importer/importer.py#L69-L74

I don't know enough about PlanPro to suggest a fix myself. Hope this helps :)

@arneboockmeyer
Copy link
Member

@SaturnHafen This problem is fixed in here: simulate-digital-rail/planpro-importer#6 That PR is waiting for review, but please try to checkout that branch and test it again. If it works, please close this issue.

@SaturnHafen
Copy link
Contributor Author

SaturnHafen commented Jan 25, 2023

Trying to install the package on the new branch using poetry (Adjusting the corresponding line in pyproject.toml and running poetry lock and poetry install) fails due to mismatching dependency-versions on the new branch*. Regardless if the fix works, we would need to update the dependencies here (using poetry lock), otherwise the fix would not be installed when using poetry install. I am going to leave the issue open until that has happened.

*If you are interested in the dependency-problems:

Because planpro-importer (1.9.0) @ git+https://github.com/simulate-digital-rail/planpro-importer@coordinates-name depends on yaramo (0.1.0) @ git+https://github.com/simulate-digital-rail/yaramo.git
 and sumoexporter depends on yaramo (0.1.0) @ git+https://github.com/simulate-digital-rail/yaramo, planpro-importer is forbidden.
So, because sumoexporter depends on planpro_importer (1.9.0) @ git+https://github.com/simulate-digital-rail/planpro-importer@coordinates-name, version solving failed.

My guess is that the different projects (sumo-exporter and planpro-importer) depend on different commit-hashes of yaramo which creates this specific problem. We might need to watch out when merging the modified poetry.lock-file here so this issue does not prevent others from trying the example.

@jeriox
Copy link
Member

jeriox commented Jan 25, 2023

Trying to install the package on the new branch using poetry (Adjusting the corresponding line in pyproject.toml and running poetry lock and poetry install) fails due to mismatching dependency-versions on the new branch*. Regardless if the fix works, we would need to update the dependencies here (using poetry lock), otherwise the fix would not be installed when using poetry install. I am going to leave the issue open until that has happened.

*If you are interested in the dependency-problems:

Because planpro-importer (1.9.0) @ git+https://github.com/simulate-digital-rail/planpro-importer@coordinates-name depends on yaramo (0.1.0) @ git+https://github.com/simulate-digital-rail/yaramo.git
 and sumoexporter depends on yaramo (0.1.0) @ git+https://github.com/simulate-digital-rail/yaramo, planpro-importer is forbidden.
So, because sumoexporter depends on planpro_importer (1.9.0) @ git+https://github.com/simulate-digital-rail/planpro-importer@coordinates-name, version solving failed.

My guess is that the different projects (sumo-exporter and planpro-importer) depend on different commit-hashes of yaramo which creates this specific problem. We might need to watch out when merging the modified poetry.lock-file here so this issue does not prevent others from trying the example.

Different commit hashes aren't a problem for poetry as it understands the relation between different commits in git. This is due to the fact that one project depens on the URL ending with yaramo.git, the other on one ending in yaramo. This was fixed in simulate-digital-rail/planpro-importer@d7922c4, but the branch in simulate-digital-rail/planpro-importer#6 is out of date with the main branch, so it doesn't contain this fix and breaks.

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

No branches or pull requests

3 participants