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

Automate renaming of courses with a script #835

Open
Jimvy opened this issue Jun 17, 2020 · 0 comments
Open

Automate renaming of courses with a script #835

Jimvy opened this issue Jun 17, 2020 · 0 comments

Comments

@Jimvy
Copy link
Collaborator

Jimvy commented Jun 17, 2020

As seen in #834 #833 and #820 , the renaming of a course can be tedious.
I think it is time to think about automating this.
Even if it happens rarely, with the master reform approaching, it is likely that a lot of courses will be shuffled around and modified so that #820 will probably be a rather small PR.
(This is especially true for the INGI courses...)
What could be inside this script:

  • moving course from quadri;
  • rename the course code (ex: edp, physique, crypto...);
  • rename the course name (ex: "EDP et analyse complexe", "Physique", "Cryptography"...);
  • any combination of the three.
    And the script would go into each appropriate file (.mk and .tex) and would patch it accordingly.
Jimvy added a commit to Jimvy/Syntheses that referenced this issue Jul 9, 2020
As suggested in Gp2mv3#835

Currently, this script supports the following:
- Change of quadri
- Change of course code (either the option like SINF or the number like
  1252)
- Change of course name (like coo, os...)
- Change of course title

In order to make it work and keep the other scripts functional, I had to
change a bit the config.yml, so that it stays with the "names" at the
end of file even after PyYAML's reordering.

Current limitations:
- Has some difficulties when different courses share the same course
  name, as it considers that only one course has a given course name
  (in database parlance, the course name is a primary key). This breaks
  for crypto q7/q8, and also for meca, elec, math etc courses.
- For now, exams and tests have their \hypertitle also updated.
  Maybe we should keep the old quadri/title/course code in old exams.
  Open to discussion (it's a 3 lines fix in the code).
- It leaves the working tree without any addition to Git; maybe we can
  integrate Git with it, so that it git adds the files.
- On Windows, one has to call it using explicitly python; it's more a
  feature than a bug however...
Bad things:
- It's extremely over-engineered probably, but at least it supports
  nearly all corner cases that I can think of.
- Python 3 + Windows + Unicode + PyYAML = nuclear explosion of bugs and
  strange issues.
@Jimvy Jimvy mentioned this issue Jul 9, 2020
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

1 participant