User talk:Slashme
Parliament diagram tool
[edit]Hallo David, du hast ermöglicht für ein neues Diagramm Parteien mit ihren Namen und Farben aus einer bestehenden Dateibeschreibung zu übernehmen. Dazu werden die Legends ausglesen. Inzwischen ist aber Legtab state-of-the-art, und wird auch sehr oft verwendet. Bei der Validierung wird regelmässig Legend durch Legtab ersetzt, so dass nun sowohl-als auch vorkommt; und vom tool verarbeitet werden sollte. Kann ja nicht schwierig sein das tool zu erweitern, wenn du mal Zeit dafü hast ! -- sarang♥사랑 16:28, 26 June 2023 (UTC)
- Ein guter Vorschlag, danke für den Hinweis! --Slashme (talk) 08:39, 29 June 2023 (UTC)
Parliamentdiagram tool down
[edit]Hi, just tried to access ParliamentDiagram and was greeted with an error, any reason why this would be happening? GlowstoneUnknown (talk) 08:03, 28 April 2024 (UTC)
- Hi GlowstoneUnknown, the tool depends on PHP7.3 and this seems not to be working right now. I've asked on the mailing list and will fix as soon as possible. --Slashme (talk) 09:09, 28 April 2024 (UTC)
- In the meantime, is there any way the program could be run offline through an IDE or a local apache server (by downloading the source code off github)? If so, could you recommend me a good IDE to use or a method to set up the local server? GlowstoneUnknown (talk) 12:40, 28 April 2024 (UTC)
- Hi GlowstoneUnknown, you could just run the python code from the command line. This will generate an SVG file that you can upload to Wikimedia Commons. If that's good enough until I manage to get the tool running again, let me know and I'll give you detailed instructions. If you want to run it on a local server, you need to put the files in the github repository inside the "public_html" directory. You also need PHP 7.3 and Python to be running on your server, and you need to put the jscolor script from jscolor.com in there as well. --Slashme (talk) 13:18, 28 April 2024 (UTC)
- Hi @Slashme, well it couldn't hurt to try that method, are you saying it wouldn't need to be running on a server if I did it all from the command line? If so, as long I have some decent instructions and/or documentation I believe I'd be able to handle it and upload the file to Commons manually. I'd be greatly appreciative if you could give me some instructions for how to do that. Thanks in advance, GlowstoneUnknown (talk) 13:38, 28 April 2024 (UTC)
- Hi Slashme, just following up on your offer of instructions for running the tool in the command line. No rush and no obligation for you to send it though, would just like to know if you'll be sending it any time soon or if you've decided against it. GlowstoneUnknown (talk) 08:01, 29 April 2024 (UTC)
- Hi GlowstoneUnknown, I'll send detailed instructions this afternoon after work, because I need to test it. There have been some changes to the code since I last ran it in command line mode. The basic idea is that you download the Python code, comment out lines 31-33 (which grab the list of parties from the web form) and uncomment line 34 (which grabs it from the command line). You then run it with the list of parties formatted the same way that the web form would do it. I'll give you that format some time in the next few hours. In the meantime, you can try downloading and running the code to check that your Python setup is OK, etc. --Slashme (talk) 08:31, 29 April 2024 (UTC)
- Hi Slashme, I imagine I'm missing something here, as when I comment 31-33, lines 42 and 436 spit out errors:
File "newarch.py", line 436, in <module>
- main()
- File "newarch.py", line 42, in main
- request_hash = str(hash(data) % ((sys.maxsize + 1) * 2))
NameError: name 'data' is not defined
- If I comment out lines 42-56, these errors are no longer spat out, is there any reason to keep them? GlowstoneUnknown (talk) 11:21, 29 April 2024 (UTC)
- Slashme, if I comment out those lines, and run this in an ide (specifically Pycharm):
python3.10 newarch.py {'parties': {[{'name' : party1,'nb_seats' : 25,'color' : #abcdef,'border_size' : 0,'border_color' : #abcdef}, {'name' : party2,'nb_seats' : 15,'color' : #fedcba,'border_size' : 0,'border_color' : #abcdef}, ],'denser_rows' : 0}}
I get exit code 0, so presumably it worked on some level, but I'm not sure how to get from there to an svg file output. Am I missing anything here? GlowstoneUnknown (talk) 05:21, 30 April 2024 (UTC)
- Slashme, if I comment out those lines, and run this in an ide (specifically Pycharm):
- Hi @Slashme, well it couldn't hurt to try that method, are you saying it wouldn't need to be running on a server if I did it all from the command line? If so, as long I have some decent instructions and/or documentation I believe I'd be able to handle it and upload the file to Commons manually. I'd be greatly appreciative if you could give me some instructions for how to do that. Thanks in advance, GlowstoneUnknown (talk) 13:38, 28 April 2024 (UTC)
- Hi GlowstoneUnknown, I've created a version for commandline testing here: https://github.com/slashme/parliamentdiagram/blob/commandline/newarch.py . You need to create a directory "svgfiles" to accept the created file, and the correct format for the commandline input is like this:
python3 newarch.py '{"parties": [{"name" : "party1","nb_seats" : 25,"color" : "#abcdef","border_size" : 0,"border_color" : "#abcdef"}, {"name" : "party2","nb_seats" : 15,"color" : "#fedcba","border_size" : 0,"border_color" : "#abcdef"} ],"denser_rows" : 0}'
- I'll work on getting the website up now! --Slashme (talk) 05:23, 1 May 2024 (UTC)
- Thank you so much! This works perfectly! GlowstoneUnknown (talk) 15:18, 1 May 2024 (UTC)
- I'll work on getting the website up now! --Slashme (talk) 05:23, 1 May 2024 (UTC)
Hi GlowstoneUnknown, the web interface is up and running again! --Slashme (talk) 06:43, 1 May 2024 (UTC)
- Oh that's great to hear as well! I still super appreciate you taking time out of your day to rewrite it for the commandline as well. And it's good to know that there's a version that exists that works if the website goes down again. GlowstoneUnknown (talk) 15:19, 1 May 2024 (UTC)
Suggestion/Error/bug after updated code
[edit]Hi @Slashme, I'm not sure if this was your intention nor am I sure it's technically considered a "bug", so I hesitate to put this on the github issue tracker, but there's been some sort of change to the code in the last 6-7 months that has changed the way diagrams with fewer seats are generated. File:Sint Maarten Estates 2024.svg
has two compact rows with large circles, but when I attempted to generate an updated version for the latest election this month, I was met with
this when using the full-rows diagram, and
this when using the compact rows.
My solution was to use the the original January file as a base and colour the parties manually based on the August results (using the compact-rows diagram I generated as a basis for where to colour them). Personally, I think the January diagram looks way more visually appealing than the ones I just generated, and I thought I'd draw it to your attention to see if the new method for generating compact-row diagrams with very few seats is having the desired effect on the outcome or if it's something that needs to be fixed to restore the original style. – GlowstoneUnknown (Talk) 08:19, 26 August 2024 (UTC)
The tool is not working
[edit]Hi, I have been trying to access the Parliament Planner tool since yesterday and it is still not working. Is there maintenance for the tool? Thank you very much. Ahmadf.alabbasi (talk) 04:06, 13 September 2024 (UTC)