Save unit registry to file
As it is possible to load unit definitions from a file, would it be possible to add a "save_as_file" function? This would allow to create units dynamically and save them on disk for re-use later ?
That is not possible but there was also an idea to support a user configurable unit definition list that is stored in the home directory and loaded automatically upon start. I do not know if there is really a demand for this.
I'd be interesting in something like this to speed up loading all the unit definitions. Profiling on my system, just loading the definition takes about 700ms, mostly parsing/tokenzing, and then using the definitions to do a single unit version takes the other 50ms. I tried just pickling the UnitRegistry but no luck.
I should be possible to create a cache file by pickling the internal dictionaries and load them if the definition files have not changed.