Describe the bug
Thank you for a great project @HassanEmam!
I would like to use the library to pull out all predecessors to an activity. Once I find the activity and try to print predecessors (project.activity.predecessors) I am getting an error: TypeError("Predecessors.get_predecessors() missing 1 required positional argument: 'act_id'")
Full error:
'Traceback (most recent call last):\n File "location\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_resolver.py", line 192, in _get_py_dictionary\n attr = getattr(var, name)\n File "location\Python\Python310\lib\site-packages\xerparser\model\classes\task.py", line 318, in predecessors\n return Predecessors.get_predecessors(self.task_id)\nTypeError: Predecessors.get_predecessors() missing 1 required positional argument: 'act_id'\n'
Same issue with successors. I am assuming this has something to do with XER file that I have but just wanted to confirm. Thank you!
To Reproduce
Attempt to print predecessors to an activity
My code is straight-forward:
from xerparser.reader import Reader
filename = "my.xer"
xer = Reader(filename) # this returns a reader object
for project in xer.projects:
if(project.proj_short_name == "my_project"):
print("PROJECT: " + project.proj_short_name + "*****")
for activity in project.activities:
if(activity.task_name == "my_activity"):
print("Activity ID | ", activity.task_code, " | Activity Name | ", activity.task_name, " | Pred |", activity.predecessors)
else:
continue
Expected behavior
Print a list of predecessors
Screenshots
N/A
Desktop (please complete the following information):
- OS: Windows 10
- Python: 3.10
Smartphone (please complete the following information):
Additional context
N/A