Giter Site home page Giter Site logo

Comments (9)

epogrebnyak avatar epogrebnyak commented on July 22, 2024

Thanks for detailed review @bakakaldsas. It looks like in non-main case we are using the PathHelper only in runner.py, which is good as for entry point. I'm thinking about to inject PathHelper.locate_csv() and get_processed() folder into default parametrrs of Vintage init to make dependency more explict

from parser-rosstat-kep.

epogrebnyak avatar epogrebnyak commented on July 22, 2024

What is missing from the review however is extensive use of helpers in other subpackages of src, like download and word2csv, lets do that later.

from parser-rosstat-kep.

epogrebnyak avatar epogrebnyak commented on July 22, 2024

Finally, some code from test_various_bugs.py that is not related to csv2df may go to src/tests

from parser-rosstat-kep.

epogrebnyak avatar epogrebnyak commented on July 22, 2024

Also - helper is used in src/*.py files a lot

from parser-rosstat-kep.

bakakaldsas avatar bakakaldsas commented on July 22, 2024

Info updated.

from parser-rosstat-kep.

epogrebnyak avatar epogrebnyak commented on July 22, 2024

In a wierd word of Win-linux combination I run this to find 'PathHelper'

 for /f %G in ('dir *.py /s/b') do (grep -nH 'PathHelper' %G) 1>> 1.txt

from parser-rosstat-kep.

epogrebnyak avatar epogrebnyak commented on July 22, 2024

or rather this, in linux:

$ find . -type f -name "*.py" ! -name "__init__.py" ! -name "test*" | xargs grep -nH 'PathHelper'

After review this gives us:

m ./csv2df/reader.py:315:    from config import PathHelper, DateHelper
m ./csv2df/reader.py:320:    csv_path = PathHelper.locate_csv(year, month)
m ./csv2df/parser.py:159:    from config import PathHelper, DateHelper
m ./csv2df/parser.py:167:    csv_path = PathHelper.locate_csv(year, month)

+./config.py:9:    - :func:`PathHelper.locate_csv` retrieves interim CSV file for parsing
+./config.py:133:class PathHelper:

+./csv2df/runner.py:20:from config import PathHelper
+./csv2df/runner.py:54:    def __init__(self, year, month, path_helper=PathHelper):

+./download/download.py:11:from config import PathHelper
+./download/download.py:13:UNPACK_RAR_EXE = PathHelper.get_unrar_binary()
+./download/download.py:44:        folder = PathHelper.get_raw_folder(year, month)

+./finaliser.py:10:from config import PathHelper, DateHelper
+./finaliser.py:24:    src_folder = PathHelper.get_processed_folder(year, month)
+./finaliser.py:25:    dst_folder = PathHelper.get_latest_folder()
+./finaliser.py:50:    filepath = PathHelper.get_xl_path()

-./example.py:126:from csv2df.helpers import PathHelper
-./example.py:128:csv_path = PathHelper.locate_csv(year, month)

+./getter.py:7:from config import PathHelper
+./getter.py:21:    path = PathHelper.get_latest_csv(freq)

from parser-rosstat-kep.

bakakaldsas avatar bakakaldsas commented on July 22, 2024
  • Yes. Simple searching finds the usage in no time. However I added a bit more expanded usage.
    E.g. in stead of just: "./download/download.py:13:UNPACK_RAR_EXE = PathHelper.get_unrar_binary()"
    I located where is UNPACK_RAR_EXE used later:
def unrar(path, folder, unrar=UNPACK_RAR_EXE):
  • And I missed example.py as it still has import with old file name: from csv2df.helpers import PathHelper
    And that needs to be fixed.

  • Either way combination of both approaches would probably yield most detailed results, but is probably too time consuming.

from parser-rosstat-kep.

epogrebnyak avatar epogrebnyak commented on July 22, 2024

Sure, from grep you see not usage, but it is good as to keep a list. Your listing and grep compliment each other.

from parser-rosstat-kep.

Related Issues (20)

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.