Closed Fivefold closed 5 months ago
Hello @Fivefold
Yes this is an intended behavior. I'm not sure about special characters like the Ω symbol, I have never tested it on InvenTree side. Does it work there?
I can manually create the parameters in Inventree (e.g. using mΩ
for the unit). If I use the variant with hex codes (m\xCE\xA9
or "m\xCE\xA9"
) I get the same error as in the API.
Also, a question: if this is intended behaviour, the parameters.yaml is not user-changeable, right? I.e. I can't use it to create a bunch of custom parameters in inventree (via Ki-nTree). Because any changes I do to parameters.yaml get removed once I run Ki-nTree or it's setup command/module
I'm not sure if the YAML file can store the Ω
symbol? 🤔
It should be fine for you to set parameters in the parameters.yaml
file, they shouldn't get overwritten. If they are then there is definitely a bug.
That's the behaviour I'm experiencing. parameters.yaml
always gets changed to the same faulty state upon start of Ki-nTree, as described above. I can make a video if needed.
I worked around this by creating the parameters by hand in InvenTree, so I personally don't urgently need a fix.
i have the same problem to make it work i deleted the special chars and manually added them to inventree using the admin page
I'm trying a fresh inventree + Ki-nTree setup and have the following problem:
When running
python3 -m kintree.setup_inventree
I get the following "Invalid physical unit" error during parameter creation:Note how it says
'units': 'mΩ'
in the error message.The offending line is https://github.com/sparkmicro/Ki-nTree/blob/7f894dd5f1d89bce128e022bcd39fa7fb603d890/kintree/config/inventree/parameters.yaml#L10 which gets changed to
immediately upon running
python3 -m kintree.setup_inventree
(or simply runningkintree
) and before the parameter creation.Also the two comment lines at the start get removed: https://github.com/sparkmicro/Ki-nTree/blob/7f894dd5f1d89bce128e022bcd39fa7fb603d890/kintree/config/inventree/parameters.yaml#L1-L2
It seems the file actually gets overwritten, because if I delete the offending lines and start kintree, I get them back (in the described state as above).
Things I've tried
I had an old version of kintree from over a year ago installed so I thought it might be related to old config files. But removing the config folder and reinstalling kintree via pip to start from fresh did not help.
I also tried manually overwriting the
parameters.yaml
directly after startup without success. Seems it's already loaded into memory at that point.Making
parameters.yaml
write-protected leads to a Permission denied Error upon starting Ki-nTree. Maybe the error is helpful, since it shows where the file is accessed in the code:Error message
``` Traceback (most recent call last): File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\site-packages\kintree\setup_inventree.py", line 3, inVersion information:
Windows 10 Pro 22H2 Inventree 0.12.10 Ki-nTree 1.0.4