Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the returns library dependency #3

Open
chuckwondo opened this issue Oct 4, 2022 · 0 comments
Open

Remove the returns library dependency #3

chuckwondo opened this issue Oct 4, 2022 · 0 comments
Labels
chore Non-functional work, such as refactoring or reformatting

Comments

@chuckwondo
Copy link
Collaborator

chuckwondo commented Oct 4, 2022

I originally introduced the returns library in order to experiment with writing more Functional Programming oriented Python.

While it was a worthwhile experiment, I'm in favor of removing it for at least the following reasons:

  1. Most importantly, it seems to swallow tracebacks, making it extremely difficult (if not impossible) to debug errors
  2. The types and type hints are quite complex (perhaps convoluted), making it extremely difficult to decipher typing errors, and thus making it difficult to know how to correct such errors (or even to know when to ignore them)
  3. Various parts of the API are perhaps a bit convoluted, making our code hard to read. In part, this is likely due to the introduction of FP-style of code, which can be a bit cryptic to those unfamiliar with various FP concepts, so this is not completely unexpected. However, the library itself seems to only compound the difficulty in deciphering the code.

At another point, I would like to consider what appear to be a cleaner, simpler, more approachable, and more robust FP libraries (pfun or pymonad), as I believe exploring FP concepts again/further is still worthwhile, particularly in the context of a smaller codebase, such as this one. However, for now, I want to simply remove the use of returns so that we can address the points above.

@chuckwondo chuckwondo transferred this issue from MAAP-Project/maap-documentation-examples Oct 15, 2022
@chuckwondo chuckwondo added the chore Non-functional work, such as refactoring or reformatting label Jul 21, 2023
chuckwondo added a commit that referenced this issue Mar 18, 2024
In addition:

- Fixed S3 credentials caching bug mentioned in a comment on #14
- Removed use of `returns` library from the granule download
  function and its related functions, as an incremental step
  towards addressing #3
- Replaced ShellCheck pre-commit check that uses a Docker container
  with direct use of shellcheck (added to dev dependencies) so that
  pre-commit can be run within the ADE (since the ADE does not have
  Docker installed)
chuckwondo added a commit that referenced this issue Mar 19, 2024
In addition:

- Fix S3 credentials caching bug mentioned in a comment on #14
- Remove use of `returns` library from the granule download
  function and its related functions, as an incremental step
  towards addressing #3
- Replace ShellCheck pre-commit check that uses a Docker container
  with direct use of shellcheck (added to dev dependencies) so that
  pre-commit can be run within the ADE (since the ADE does not have
  Docker installed)
- Fix "conda: command not found" error

  Replace `conda` with `"${CONDA_EXE:-conda}"` in all scripts to prevent
  scripts from failing due to not finding the `conda` command, which can
  happen when a script attempts to invoke conda from a subshell, and the
  subshell doesn't initialize conda.

- Use `--live-stream` instead of `--no-capture-output` with `conda run`.
  These are synonyms, so this is simply a preference change.
- Update pre-commit hooks and related dependencies
- Reformat py files using `black`, which was previously accidentally
  excluded from pre-commit.
- Update tests to match changes in maap-py types
- Add conda lock file generation to pre-commit
- Drop .sh suffix from shell scripts for convenience
- Simplify build, run, and dev setup and update `CONTRIBUTING.md`
  accordingly.

Fixes #44
chuckwondo added a commit that referenced this issue Mar 19, 2024
In addition:

- Fix S3 credentials caching bug mentioned in a comment on #14
- Remove use of `returns` library from the granule download
  function and its related functions, as an incremental step
  towards addressing #3
- Replace ShellCheck pre-commit check that uses a Docker container
  with direct use of shellcheck (added to dev dependencies) so that
  pre-commit can be run within the ADE (since the ADE does not have
  Docker installed)
- Fix "conda: command not found" error

  Replace `conda` with `"${CONDA_EXE:-conda}"` in all scripts to prevent
  scripts from failing due to not finding the `conda` command, which can
  happen when a script attempts to invoke conda from a subshell, and the
  subshell doesn't initialize conda.

- Use `--live-stream` instead of `--no-capture-output` with `conda run`.
  These are synonyms, so this is simply a preference change.
- Update pre-commit hooks and related dependencies
- Reformat py files using `black`, which was previously accidentally
  excluded from pre-commit.
- Update tests to match changes in maap-py types
- Add conda lock file generation to pre-commit
- Drop .sh suffix from shell scripts for convenience
- Simplify build, run, and dev setup and update `CONTRIBUTING.md`
  accordingly.

Fixes #44
chuckwondo added a commit that referenced this issue Mar 19, 2024
In addition:

- Fix S3 credentials caching bug mentioned in a comment on #14
- Remove use of `returns` library from the granule download
  function and its related functions, as an incremental step
  towards addressing #3
- Replace ShellCheck pre-commit check that uses a Docker container
  with direct use of shellcheck (added to dev dependencies) so that
  pre-commit can be run within the ADE (since the ADE does not have
  Docker installed)
- Fix "conda: command not found" error

  Replace `conda` with `"${CONDA_EXE:-conda}"` in all scripts to prevent
  scripts from failing due to not finding the `conda` command, which can
  happen when a script attempts to invoke conda from a subshell, and the
  subshell doesn't initialize conda.

- Use `--live-stream` instead of `--no-capture-output` with `conda run`.
  These are synonyms, so this is simply a preference change.
- Update pre-commit hooks and related dependencies
- Reformat py files using `black`, which was previously accidentally
  excluded from pre-commit.
- Update tests to match changes in maap-py types
- Add conda lock file generation to pre-commit
- Drop .sh suffix from shell scripts for convenience
- Simplify build, run, and dev setup and update `CONTRIBUTING.md`
  accordingly.

Fixes #44
chuckwondo added a commit that referenced this issue Mar 25, 2024
In addition:

- Fix S3 credentials caching bug mentioned in a comment on #14
- Remove use of `returns` library from the granule download
  function and its related functions, as an incremental step
  towards addressing #3
- Replace ShellCheck pre-commit check that uses a Docker container
  with direct use of shellcheck (added to dev dependencies) so that
  pre-commit can be run within the ADE (since the ADE does not have
  Docker installed)
- Fix "conda: command not found" error

  Replace `conda` with `"${CONDA_EXE:-conda}"` in all scripts to prevent
  scripts from failing due to not finding the `conda` command, which can
  happen when a script attempts to invoke conda from a subshell, and the
  subshell doesn't initialize conda.

- Use `--live-stream` instead of `--no-capture-output` with `conda run`.
  These are synonyms, so this is simply a preference change.
- Update pre-commit hooks and related dependencies
- Reformat py files using `black`, which was previously accidentally
  excluded from pre-commit.
- Update tests to match changes in maap-py types
- Add conda lock file generation to pre-commit
- Drop .sh suffix from shell scripts for convenience
- Simplify build, run, and dev setup and update `CONTRIBUTING.md`
  accordingly.

Fixes #44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Non-functional work, such as refactoring or reformatting
Projects
None yet
Development

No branches or pull requests

1 participant