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

add learnMSA #51042

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

add learnMSA #51042

wants to merge 1 commit into from

Conversation

rlibouba
Copy link
Contributor

@rlibouba rlibouba commented Sep 30, 2024

Hello,
I'm opening this PR to add learnMSA to the tiberius conda package.
Thank you! Have a good day!

Summary by CodeRabbit

  • New Features

    • Enhanced build process with added dependency handling for compatibility.
    • New command to verify Keras accessibility during testing.
  • Bug Fixes

    • Ensured tiberius.py file is executable and created a symbolic link.
  • Documentation

    • Updated version number in the package metadata.
    • Revised runtime requirements to support newer versions of Python and libraries.

@rlibouba rlibouba marked this pull request as draft September 30, 2024 09:29
Copy link
Contributor

coderabbitai bot commented Sep 30, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the build.sh script and the meta.yaml file for the tiberius package. The build.sh script now includes functionality to clone the learnMSA repository and install it, ensures the tiberius.py file is executable, and adds a symbolic link. The meta.yaml file updates the package version, alters runtime requirements for Python, TensorFlow, Keras, and NumPy, and adds a test command to verify Keras accessibility.

Changes

Files Change Summary
recipes/tiberius/build.sh Modified to clone learnMSA from GitHub, checkout parallel branch, and install via pip; ensures tiberius.py is executable and creates a symbolic link; added newline at end of file.
recipes/tiberius/meta.yaml Updated version from 0 to 1; changed Python requirement to >=3.10; specified tensorflow >=2.9, added keras ==2.10.0, and numpy >=1.21; added test command for Keras accessibility.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rlibouba rlibouba marked this pull request as ready for review September 30, 2024 10:38
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
recipes/tiberius/build.sh (1)

9-15: Consider long-term strategy for learnMSA integration

While the current changes provide a working solution for incorporating learnMSA, there are some concerns about the long-term strategy:

  1. The temporary nature of this solution is clear, but there's no indication of when or how it will be replaced with a permanent solution.
  2. This approach of cloning and installing during the build process might not be ideal for a conda package, which typically relies on pre-built dependencies.

Consider the following suggestions:

  1. Add a TODO comment with a timeline or condition for removing this temporary solution.
  2. Investigate if learnMSA can be packaged separately as a conda package, which would allow it to be included as a dependency in meta.yaml instead of being installed in the build script.
  3. If the current approach is necessary for now, document the reasoning and any plans for future changes in a comment within the script or in the package documentation.
🧰 Tools
🪛 Shellcheck

[warning] 12-12: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

recipes/tiberius/meta.yaml (1)

39-39: LGTM: Good addition of Keras accessibility test.

The new test command to verify Keras installation and accessibility is a valuable addition. It ensures that Keras is properly installed and can be imported, which is crucial given the new explicit requirement for Keras.

Consider extending the test to verify the specific version of Keras, given the strict version requirement in the run dependencies. You could modify the test command as follows:

test:
  commands:
    - tiberius -h
    - python -c "import tensorflow.keras as keras; assert keras.__version__ == '2.10.0', f'Expected Keras version 2.10.0, but got {keras.__version__}'; print('Keras 2.10.0 is installed and accessible')"

This will ensure that not only is Keras accessible, but it's also the exact version specified in the requirements.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c69d1bb and 24b8b3c.

📒 Files selected for processing (2)
  • recipes/tiberius/build.sh (1 hunks)
  • recipes/tiberius/meta.yaml (3 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/tiberius/build.sh

[warning] 12-12: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🔇 Additional comments (2)
recipes/tiberius/build.sh (1)

7-7: LGTM: Appropriate shebang addition

Adding the Python 3 shebang to the tiberius script is a good practice. It ensures that the script will be executed with the correct interpreter.

recipes/tiberius/meta.yaml (1)

13-13: LGTM: Build number increment is appropriate.

The build number has been correctly incremented from 0 to 1. This is the right approach when making changes to a package without altering its version number.

Comment on lines +9 to +15
#Adding learnMSA
git clone https://github.com/Gaius-Augustus/learnMSA
cd learnMSA
git checkout parallel
pip install .
cd ..
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve error handling and cleanup in temporary learnMSA installation

While the temporary installation of learnMSA is clearly documented, there are a few improvements that could make this process more robust:

  1. Add error handling to the git and pip commands to ensure the script fails if these critical steps fail.
  2. Return to the original directory after the installation is complete.
  3. Consider cleaning up the cloned repository after installation to save space.

Here's a suggested improvement:

 #Temporary: until the specific branch of learnMSA compatible with Tiberius is merged
 #Adding learnMSA
-git clone https://github.com/Gaius-Augustus/learnMSA
-cd learnMSA
-git checkout parallel
-pip install .
-cd ..
+git clone https://github.com/Gaius-Augustus/learnMSA || exit 1
+cd learnMSA || exit 1
+git checkout parallel || exit 1
+pip install . || exit 1
+cd ..
+rm -rf learnMSA

This change addresses the static analysis warning about cd potentially failing, adds error handling to all commands, and includes cleanup of the cloned repository.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#Temporary: until the specific branch of learnMSA compatible with Tiberius is merged
#Adding learnMSA
git clone https://github.com/Gaius-Augustus/learnMSA
cd learnMSA
git checkout parallel
pip install .
cd ..
#Temporary: until the specific branch of learnMSA compatible with Tiberius is merged
#Adding learnMSA
git clone https://github.com/Gaius-Augustus/learnMSA || exit 1
cd learnMSA || exit 1
git checkout parallel || exit 1
pip install . || exit 1
cd ..
rm -rf learnMSA
🧰 Tools
🪛 Shellcheck

[warning] 12-12: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not suggest to add such verbose line by line error handling.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do that for any recipe script in this repo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johanneskoester Understood, I will avoid suggesting such verbose line-by-line error handling in the future.

(_/)
(•_•)
/>📝


✏️ Learnings added
Learnt from: johanneskoester
PR: bioconda/bioconda-recipes#51042
File: recipes/tiberius/build.sh:9-15
Timestamp: 2024-09-30T16:19:54.319Z
Learning: Avoid suggesting verbose line-by-line error handling in scripts.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johanneskoester, understood. I will avoid suggesting such verbose line-by-line error handling in recipe scripts for this repository in the future.


✏️ Learnings added
Learnt from: johanneskoester
PR: bioconda/bioconda-recipes#51042
File: recipes/tiberius/build.sh:9-15
Timestamp: 2024-09-30T16:23:14.125Z
Learning: For the bioconda/bioconda-recipes repository, do not suggest adding verbose line-by-line error handling in recipe scripts.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment on lines +23 to +27
- tensorflow >=2.9
- keras ==2.10.0
- python >=3.10
- pip
- tensorflow
- numpy >=1.21
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Review and adjust package requirements.

The changes to the requirements section are generally good, but there are a few points to consider:

  1. The Python version requirement has been significantly increased from >=3.7 to >=3.10. This is a major change that could affect compatibility. Please ensure this is necessary and documented.

  2. The strict version requirement for keras (==2.10.0) might be too restrictive. Consider using a more flexible version specifier like >=2.10.0,<2.11 to allow for minor updates and patches.

  3. The order of requirements is not standard. Typically, python is listed first. Consider reordering the requirements.

Suggested changes:

requirements:
  run:
    - python >=3.10
    - tensorflow >=2.9
    - keras >=2.10.0,<2.11
    - numpy >=1.21 
    - pip
    # ... (rest of the requirements)

Also, please provide justification for the significant increase in the Python version requirement, as this could impact users of the package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai, when reviewing package dependencies here, always mention that they should align as close as possible with the upstream description of the packaged software.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do that for all recipes in this repo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johanneskoester, understood. I'll make sure to mention that package dependencies should align as closely as possible with the upstream description when reviewing dependencies in all recipes in this repository.

(_/)
(•ᵕ•)
📖


✏️ Learnings added
Learnt from: johanneskoester
PR: bioconda/bioconda-recipes#51042
File: recipes/tiberius/meta.yaml:23-27
Timestamp: 2024-09-30T16:18:06.774Z
Learning: When reviewing package dependencies in this repository, always mention that they should align as closely as possible with the upstream description of the packaged software.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johanneskoester, thank you for the guidance. In future reviews, I will ensure to mention that package dependencies should align as closely as possible with the upstream description of the packaged software.

(_/)
(•‿•)
/ 📝


✏️ Learnings added
Learnt from: johanneskoester
PR: bioconda/bioconda-recipes#51042
File: recipes/tiberius/meta.yaml:23-27
Timestamp: 2024-09-30T16:18:35.932Z
Learning: When reviewing package dependencies, always mention that they should align as closely as possible with the upstream description of the packaged software.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

#Temporary: until the specific branch of learnMSA compatible with Tiberius is merged
#Adding learnMSA
git clone https://github.com/Gaius-Augustus/learnMSA
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use a URL in the meta.yml like this: https://github.com/Gaius-Augustus/learnMSA/archive/refs/heads/parallel.tar.gz

However, we should not release branches that are not in main IMHO. maybe a new package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the tiberius repository, they indicate to use the parallel branch to run the tool. I asked the question on leanrMSA's repository. Here's their answer: Gaius-Augustus/learnMSA#12 (comment)

@rlibouba rlibouba marked this pull request as draft October 1, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants