donnell74 / CSC-450-Scheduler

MIT License
1 stars 1 forks source link

Add function to create xml from yaml input #34

Closed prichey closed 10 years ago

prichey commented 10 years ago

The bulk of this commit is just including the yaml module.

The real meat of my code is in interface.py, where I created a function create_xml_from_yaml() which does what the name says. I also modified globs to call this function only if an xml input (Input.xml) is not found in genetic/seeds. In order to see the function run, make sure you have the Input.yaml file, then delete Input.xml, then run. Input.xml should be created and scheduler should run normally.

hana9235 commented 10 years ago

Looks good to me.

CameronHKIng commented 10 years ago

A few things: In your YAML input file, I noticed that you had a lab with the 001 suffix, and a lecture with the "A" suffix. This is the opposite of how it should be. Not sure if there were other errors in the YAML input.

Your logic is set up to take XML if available, else, take YAML and convert to XML. Then, if the user runs once with YAML, they will always have the XML input unless they delete it. If the user goes in and changes the YAML without deleting the XML, nothing will change, right? I would just have it always take input from YAML; it can delete the XML file each run (similar to how we delete all the old CSV output when we export).

hana9235 commented 10 years ago

Re: the lab thing I'm pretty sure that's been the way we've had it since we added lab sections. (Labs have section numbers instead of letter codes on both develop and profile.) It is incorrect, but he didn't mess it up in that respect.

I didn't think of the XML issue, though. Cameron's right on that; that should definitely be fixed.

prichey commented 10 years ago

Regarding both issues: I'll fix these asap.

Hana's right, I just copied over the Input.xml file I had, so I'll get the lab section stuff fixed up.

I'll also make the change Cameron suggested - I hadn't thought about a user altering the YAML with an outdated XML input present. That's a good catch.

CameronHKIng commented 10 years ago

Make sure to check the university's list of sections to register for. I could easily be wrong. It just seems strange to me that lecture classes are normally labeled like 'CSC 130 001', but if they have a lab, the lab is the numbered section instead and the lecture has a letter.