facebookresearch / facebookresearch/fairo

Remove `os.path.dirname` references in modules

Open
#374 0 comments 0 reactions 6 assignees Claimed by @anuragprat1k View on GitHub
hack-session-worthy refactor
Dominant language
Jupyter Notebook
Stars
929
Forks
123
PR merge metrics
No merged PRs in 30d

Description

## Type of Issue

Select the type of issue:
- [ ] Bug report (to report a bug)
- [ ] Feature request (to request an additional feature)
- [ ] Tracker (I am just using this as a tracker)
- [x] Refactor request
- [ ] Documentation Ask

## Description
Huge thanks to @soumith for removing `sys.path.append` throughout the repo. Following up from this, IMO we should also remove any references to file processing paths in modules, i.e. code that we plan to package in the future. This includes `os.path.dirname`, `os.path.join` and any other `os.path` operations that manipulate resource names being passed in modules.

This is important if we ever want to release package binaries, eg. a Wheels distribution. Use the package resource API instead. For an example on using `pkg_resources`, see [this autocomplete tool script](https://github.com/facebookresearch/droidlet/blob/main/tools/data_processing/autocomplete_postprocess.py#L98-L101).

There's not a ton of these - I can clean it up, or @soumith can take a look during your refactor?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.