Giter Site home page Giter Site logo

casimirlaine / data-compressor-python Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.7 MB

Python implementation of the Lempel-Ziv and Huffman compression algorithms

Python 100.00%
python compression decompression lz77 huffman huffman-compression-algorithm lz77-compression-algorithm

data-compressor-python's Introduction

data-compressor-python

Python PyCharm linting: pylint Pylint pages-build-deployment

Python implementation of the Lempel-Ziv and Huffman compression algorithms.

Documentation

This project supports Python version 3.10+!

First steps

Build and fetch dependencies:

python setup.py

Run configurations

Run

To run the program:

python main.py -h --help -a <algorithm> --algorithm=<algorithm> -o <output_file> --output_file=<output_file> -f <file> --file=<file> -m <method> --method=<method> <input>

Refer to the user manual for more info.

Performance Benchmarks

To run performance benchmarks:

python performance.py

Static Analysis

To run static code analysis tool (pylint):

pylint src

Testing

To run unit tests:

pytest

To run unit tests in parallel:

pytest -n auto

Generate Test Coverage

To generate and view test coverage:

pytest
open docs/index.html

On Windows:

pytest
start docs/index.html

data-compressor-python's People

Contributors

casimirlaine avatar

Stargazers

 avatar

Watchers

 avatar  avatar

data-compressor-python's Issues

Peer review

Reviewed code retrieved on 18 August 2022 at 19:30

The project shares the same subject as my own, Huffman and Lempel-Ziw data compression, although the style the code is written in differs from what I'm accustomed to (mine is a little less refined). However it is accessible and easy to follow even to someone not so advanced in the field. The quality of naming and commenting benefits to this greatly.

The project seems to be proceeding well, with most aspects underway or finished. Unfortunately I was unable run the program following the instructions given in the README file. When given command 'python setup.py', the response was:

File "setup.py", line 8
    f'python -m venv venv',
                         ^
SyntaxError: invalid syntax'

after which 'python main.py' responded:

  File "main.py", line 6
    path_prefix = f'{root_path}{os.sep}'
                                       ^
SyntaxError: invalid syntax

Perhaps the problem was at my side, but there could be a more For Dummies type of manual. The test commands worked and a coverage file was created.

Good work!

Vertaisarviointi #2

Last week I got valuable feedback from your end and this week it is my turn to give something back. Project was cloned on 25.8.2022 around 8pm.

Overall it seems that you have done a lot, I mean a LOT! I would assume that you have been working on programming for a while already. This project looks in my opinion some what more advanced that I am used to see at these student projects. That is not only a benefit for me, since I was unable to install dependencies and run the program. That could also be due to the setup I am using to test this (Rasbian OS and Python 3.7.3). I know you have pointed out in the README.md to run python setup.py first, but this step is missing in the User manual currently, remember to update it. Also User manual says:

Download and install Python version 3.10 or older.

So this is a bit misleading with README.md:

This project supports Python version 3.10+!

I do still believe that your actual program works just fine with the right setup. I try to give some comments regarding your code, but to be honest I do not have sufficient expertise to give much extra value. Overall I like the fact that most of your work is divided into own modules (especially convert.py and io.py are easy to understand and simple structured) and classes that makes it easy to read and probably modify. Code seems to be well commented. Like you said it is purely a preference to use CLI commands instead of text of graphical UI, but I'm personally not a fan of it (perhaps one reason I went with text UI).

Then some pointers that I believe would make it even more clear:

  1. One thing that is a bit confusing to me is the naming of these modules, since most of them are named init.py it is a bit challenging for me to follow in my editor which module I am currently looking at. I don't know if this is an issue for you or for most of us.
  2. In the Huffman module I would separate the Node class to it's own module for the reason that I would assume that this same class could be utilized perhaps with some other algorithm than just the Huffman one.
  3. I do not know if this is due to my setup, but pylint gave a 6.93/10 score for the code. If this is true then I guess some refactoring needs to take place.

Overall this seems like an advanced stuff and great work by a professional! Sometimes just remember to stupid it down for simple ones like myself :) Enjoy your project and looking forward to see your results with these similar algorithms that I'm working on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.