Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Tensorflow as optional dependency? #185

Closed
wants to merge 5 commits into from
Closed

Conversation

willGraham01
Copy link
Collaborator

@willGraham01 willGraham01 commented Jul 3, 2023

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
This resolves the tensorflow problem as listed on this BrainGlobe repository issue.

Worth looking at the alternative solution proposed there too.

What does this PR do?
Makes tensorflow an optional dependency and include-guards all tensorflow-functionality that cellfinder-core uses in the event that the user does not have tensorflow installed.

(Although having examined this, it looks like this means that cellfinder-core simply doesn't have any functionality to offer).

References

Please reference any existing issues/PRs that relate to this PR.

How has this PR been tested?

Is this a breaking change?

Yes - users now need to ensure they have tensorflow pre-installed in their environment, or explicitly request it to be fetched along with cellfinder-core when they install.

Does this PR require an update to the documentation?

If any features have changed, or have been added. Please explain how the documentation has been updated (and link to the associated PR). See here for details.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

- Move check for optional dependency here
- Create function decorator to wrap around tensorflow-dependent fns

Create a dummy "tf" name in the tensorflow_handle file.
This enables us to "from tensorflow_handle import tf" wherever we
might need tensorflow, and use the decorator to prevent function
execution _before_ we reach the tf name.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant