Skip to content

Enhance geopathfinder #29

@cnavacch

Description

@cnavacch

Currently, I identify several points for improving the class logic and making the package more "pythonic".

  1. Folder naming conventions/classes and file naming conventions/classes are completely decoupled. A framework uniting both classes would make sense.
  2. Add magic methods like __str__ or __add__ (e.g. adding a path to a tree) and properties like n_paths, n_files, or disk_usage to better interact with an object. Especially, replace functions doing printing, e.g. print_file_register and replace them with sth. like this https://pypi.org/project/seedir/
  3. I would prefer to have stacked function calls, which always return self, e.g. tree.filter(level, pattern='..').filter(level, pattern='..').prune(level) and not having all these "collect" functions.
  4. Temporary creation of data frames should be prevented. It would be better to have a central data frame dealing with folders and files (see get_disk_usage or search_files_ts)
  5. Building a tree is quite slow at the moment, because it uses os.walk and does not utilise parallelisation.
  6. Refactor build_smarttree in general - a lot of list appends happen there, even after one knows the "dimensions" of paths and folders.
  7. Regex patterns should be used as a general entry point for filtering folders or file names, not starting from a tuple of strings.
  8. Its currently quite difficult to understand how to use geopathfinder in detail. More docs and Jupyter Notebooks should be added.

This should just be the central issue collecting and discussing improvements or new ideas, which then can be distributed to other issues later on. Please feel free to add your ideas and thoughts - this should be considered as a brainstorming. If we come up with a specific set of tasks, we could also ask a student or a new employee to implement them.

And by the way: I did not find a package, which does already similar things - so this might be a huge benefit for the community!

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions