Closed jyp closed 8 months ago
@dbosk: should I experiment with this branch? I see that you have other alternative branches. What is your recommendation?
@jyp that would be much appreciated!
I tried to fix this a few months ago. The fix I expected to solve the problem is in that linked branch (#69). However, with that one all module titles and grading scales goes missing. Even for students for which this wasn't a problem to begin with. For instance, running ladok student -c DD2395 -r <student's ID>
yields
DD2395 81099 (2010-01-18--2010-03-21)
None P 2010-04-07
None A 2010-03-18
instead of
DD2395 81099 (2010-01-18--2010-03-21)
LAB1 P 2010-04-07
TEN1 A 2010-03-18
The same thing happens on all three branches (#69 #77 #78). So that's why I stopped last time. I figured it would take me more effort than I had time then.
If you want to dig into it, here's some instructions on how to run the code. To tangle (generate) the Python code from the literate source you'll need Noweb and the makefiles
submodule:
git clone git@github.com:dbosk/ladok3.git
git submodule update --init
sudo apt install noweb
After that it's just to run make all
in the /src/ladok3
directory.
If you want to weave the PDF, go to the /doc
directory and run:
make clean all
To run the repo version, just use poetry
.
python3 -m pip install poetry
To test changes:
make all
poetry shell
poetry install # necessary just once
[in that shell]
ladok cache clear
ladok student -c <course code> -r <student identifier>
Struck me that compiling the document won't work. I have code in there fetching some of my own data from LADOK. Which won't work for you.
ladok3.pdf is the version for #69. The changes are in section 7.2 and 7.3.
Spent some time in pdb
. Probably the problem is caused by how __init__
in <<CourseInstance methods>>
on page 28 is written. To take these faux courses into considerations in __assign_attr
, we never trigger the __pull_attributes
(we never get any exception).
Probably that part should try __pull_attributes
too. If that raises an exception, we should do a faux course version of __assign_attr
.
That's it for now. I can hopefully return to this in like two weeks.
Couldn't resist looking at it again in the morning. Please test the branch if you can, to see if my solution solves it for you as well.
The branch appears to work perfectly for my use case. Thanks a lot!
Some Chalmers students are registered to courses which don't have a grading scale. This causes the following exception to be raised when the courses data is being fetched: