LZMA filtering documentation very poor
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
I'm trying to optimise compressing some documents, so I'm using LZMA's filters. These are really badly documented: https://docs.python.org/3/library/lzma.html#filter-chain-specs
General problems:
- The filters are using short-hand for variable names
lc,lp,mf, which is really bad practice for a publically available interface (and even for internal ones!). (ok, so this isn't a doc problem, but a library one). - It's not at all clear what any of the variables do. There's no links to any documentation (even third-party) which explain what any of these things do.
- It's not clear what values are acceptable for some of them.
-
presetis documented elsewhere, and I assume the value range is the same?
-
lcdoesn't say the maximum is 4, you have to readlpto see the combined maximum is 4, and then deduce.
-
lc,lp,pc,nice_len, don't state minimums
- No defaults stated other than
depth (0), - It's not at all clear what the different Filters do.
- The limited blurb that does exist about Filter chains seems to assume a high degree of expertise in these things. For example:
The last filter in the chain must be a compression filter, and any other filters must be delta or BCJ filters.- that has cleared nothing up. - What's a
MODE_FASTorMODE_NORMALdo? - What's the difference between
MF_HC3, MF_HC4, MF_BT2, MF_BT3, or MF_BT4? - What does
lzma.PRESET_EXTREMEdo? There's no documentation forlzma.PRESET_DEFAULTat all (which my IDE exposed to me via autocomplete).
Etc etc.
Some specific problems as well:
-
'filters': [{'id': 33, 'preset': 6, 'dict_size': 262144, 'lc': 1, 'lp': 1, 'mode': 2, 'nice_len': 1, 'mf': 3}]
That creates anLZMAError. It's only after generating thousands of combinations of these that I notice a pattern:nice_len: 1. It seems there's a minimum nice_len size. This is not documented. -
'filters': [{'id': 33, 'preset': 2147483653, 'dict_size': 1073741824, 'lc': 1, 'lp': 0, 'mode': 2, 'nice_len': 201, 'mf': 20}]
Generates aMemoryError(as do lots of others of my tests). No idea why as I have plenty of RAM. I presume some combination of those settings are causing an issue, but there's no documentation warning about this.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla sezione sulle specifiche delle catene di filtri LZMA nella pagina collegata della documentazione Python e rivedi le descrizioni delle opzioni dei filtri, dei preset, delle modalità e delle catene di filtri. Documenta il significato dei parametri, gli intervalli validi, i valori predefiniti, le differenze tra i filtri e i vincoli rilevanti relativi agli errori o alla memoria, in modo che gli esempi e i casi di errore siano spiegati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100