Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
DhanshreeA authored Oct 17, 2024
2 parents ca885ce + b0b300e commit db9b2e1
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 16 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,26 @@ jobs:
git tag -a "v${{ steps.version.outputs.VERSION }}" -m "v${{ steps.version.outputs.VERSION }}"
# Tagging happens implicitly; no need to push explicitly
- name: Update version in CITATION.cff
- name: Update version and release date in CITATION.cff
id: update-citation
env:
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
RELEASE_DATE: ${{ github.run_started_at }} # This captures the timestamp when the workflow run was triggered/started

run: |
pip install PyYAML
python -c "
import os
import yaml
release_date = os.environ['RELEASE_DATE'].split('T')[0]
with open('CITATION.cff', 'r') as file:
content = file.read()
citation = yaml.safe_load(content)
citation = yaml.safe_load(file)
citation['version'] = os.environ['VERSION']
citation['date-released'] = release_date
with open('CITATION.cff', 'w') as file:
yaml.dump(citation, file, default_flow_style=False, sort_keys=False)
"
Expand All @@ -72,7 +79,7 @@ jobs:
with:
author_name: "ersilia-bot"
author_email: "[email protected]"
message: "update version [skip ci]"
message: "update version and release date [skip ci]"
repository: "ersilia-os/${{ github.event.repository.name }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
amend: true
Expand Down
45 changes: 34 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,50 @@ Thank you for contributing to Ersilia's mission and vision! ⭐

Ersilia is an open project and everyone is welcome to contribute to it. Please read the following sections to make sure your contribution aligns with Ersilia's guidelines and is an enjoyable experience for all.

## Code of Conduct
## Table of Contents

- [Code of Conduct 🤝](#code-of-conduct-)
- [Where to Start? 🧭](#where-to-start-🧭)
- [How to Contribute 📜](#how-to-contribute-)
- [Create a new Issue 🚀](#create-a-new-issue-)
- [Contribution Workflow 🔄](#contribution-workflow-)
- [Other Contributing Suggestions 💡](#other-contributing-suggestions-)
- [I still have questions ❓](#i-still-have-questions-)

## Code of Conduct 🤝

We aspire to create a welcoming and safe environment for collaboration on this project and ask all contributors to do the same. Help us keep Ersilia open and inclusive. Please read and follow our [Code of Conduct](https://github.com/ersilia-os/ersilia/blob/master/CODE_OF_CONDUCT.md).

## Where to Start?
## Where to Start? 🧭

The best place to start is by checking our issue tracker. Our issues have the following labels to guide contributors in their work:

* good first issue: a small task suitable to start your contributions to the project
* help wanted: an issue currently not assigned to anyone
* bug: fix something that is not working
* enhancement: add a new feature
* documentation: issues related to the project's documentation
| Issue Label | Description |
|------------------|-----------------------------------------------------------------|
| Good first issue | A small task suitable to start your contributions to the project|
| Help wanted | An issue currently not assigned to anyone |
| Bug | Fix something that is not working |
| Enhancement | Add a new feature |
| Documentation | Issues related to the project's documentation |

## How to Contribute 📜

If this is the first time contributing to an Open Source project, read a bit about [How to Contribute to An Open Source Project on Github](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github) and [Collaborating with pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests). If you land here during the Outreachy contribution period, please look for the appropriate guidelines in our [documentation](https://ersilia.gitbook.io/ersilia-book/contributors/internships).

## Create a new Issue 🚀

The issue tracking avoids duplications and prevents different contributors working on the same feature separately, so please make sure to create a new issue with the appropriate labels before jumping on coding!
The issue tracking avoids duplications and prevents different contributors working on the same feature separately, so please make sure to create a new issue with the appropriate labels before jumping on coding! You can create the following issue types:

| Issue Type |Description |
|-------------------|-------------------------------------------------|
|🦠 Model Request | Request to add a new model to the hub |
|🐛 Bug Report | Report something that is not working as expected|
|📑 Feature Request | Suggest a new feature or enhancement |
|🐕 Batch | Create a new Batch |
|🐅 Epic | Create a new Epic |
|🐈 Task | Create a new Task |

## Contribution Workflow
## Contribution Workflow 🔄

Once you have identified an issue to tackle, follow the next steps:

Expand All @@ -35,13 +58,13 @@ Once you have identified an issue to tackle, follow the next steps:
5. Once the PR has been merged, delete your fork of the repository. Our Git-LFS quota also takes into account forks, so having unused forks sitting around is eating up our space in Git LFS. Thanks for taking care of the community.
6. Look for a new issue to work on!

## Other Contributing Suggestions
## Other Contributing Suggestions 💡

* Support already existing contributors with comments on the issues they might be tackling
* Create new issues for bug reports or feature enhancements using the appropriate templates (even if the issue is out of scope for you, it might be a good job for another contributor)
* Suggest new models to the Ersilia Model Hub using an issue or via our online [form](https://airtable.com/shrmEcwwxpb21TEVw)
* Documentation-related enhancements are very welcome, please work on them by opening a new issue

## I still have questions
## I still have questions

If you need some more guidance, open an issue and get support from the community!
118 changes: 118 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Development
This file highlight the installation process of getting started with Ersilia, Ersilia Artifacts and Creating a Pull Request.

## Getting Started
Ersilia can be run either on local computer or with the use of GitHub codespaces. Ersilia is designed to run on **Linux or Linux-like environments** namely: MacOS, Windows Sub-system for Linux (WSL) and at present is not supported on Windows systems.

- ### Installation of Ersilia on local computer
To get started with Ersilia installation, there are few dependencies that needs to be installed before proceeding to installation of Ersilia. Please, check the package requirement in the [Installation Guide](https://ersilia.gitbook.io/ersilia-book/ersilia-model-hub/installation)
1. Once the required dependencies has been installed, open a terminal and set up a Conda environment.

```
# create a conda environment
conda create -n ersilia python=3.10
# activate the environment
conda activate ersilia
```
2. Clone the repository and run to install the Ersilia Python package.
```
# clone from github
git clone https://github.com/ersilia-os/ersilia.git
cd ersilia
# install with pip (use -e for developer mode)
pip install -e .[test]
```
**The -e (editable) for developer mode ensures that whenever a user change the code, they don't need to reinstall ersilia for those changes to take effect.**

3. To test that the CLI works, explore this command
```
# output to see command options for ersilia
ersilia --help
```
4. Once ersilia is recognized in the CLI, test any model of your choice.
- First, you can check the list of available model in ersilia's catalog
```
#see ersilia's model catalog
ersilia catalog
```
- Next, you can run the model
```
ersilia -v fetch eos2ta5 #fetch a model
ersilia serve eos2ta5 #serve a model
ersilia -v api run -i "CCCC" #run a model
```

Note: The usage -v (verbose) flag is of utmost importance for developers as it provides detailed logs which helps to debug and troubleshoot issues.

- ### Using GitHub Codespaces
If difficulties are encountered while setting up Ersilia locally, another cloud-based development environment which suppoort linux is a great alternative.
GitHub codespaces allows you to run and develop Ersilia directly from your browser.

To use Github Codespaces:

**1. Fork and Clone the Repository**

- Navigate [Ersilia repository](https://github.com/ersilia-os/ersilia) on GitHub.
- Click on the **Fork** button in the top right corner to create a fork.
- Go to the forked repository, Click on the <> **Code**.
- Click **Create codespace**.

A pop up page "Setting up your codespace" is displayed on the screen. After a while, the codespace is created in a browser-based version using the built-in Visual studio code interface

**2. Setting Up GitHub Codespaces Environment**

- Once you open the codespaces environment, ersilia has been installed and ready for usage. To double check, you can verify by running this command `ersilia --version`. This
will display the version of ersilia installed.

**3. Run Ersilia Model**
- Directly from the code space terminal, you can fetch, serve and run Ersilia model.
To run a model with verbose output:
`ersilia -v run eos2ta5`

## Ersilia Artifacts
After successful installation of ersilia in the user's local computer, the system creates an EOS directory in the user's `$HOME` path. This directory stores ersilia artifacts that the local computer uses when doing any operation (model execution) in Ersilia.
Folders found in the `$HOME` directory includes:

**Folders**
- dest/: stores output generated when running a model.
- isaura/: cache model prediction which stores them in the local computer
- repository/: main directory to cache models files and datasets. This prevent redundant download by storing previously fetched model
- sessions/: Tracks user session
- tmp/: stores temporary file during model execution.

## Creating a Pull Request
To get started, please read and follow our [Code of Conduct](https://github.com/ersilia-os/ersilia/blob/master/CODE_OF_CONDUCT.md).

Before submitting a pull request, please ensure your code has been tested. After making any changes, **run the test suites** to test the code properly.

To do this, use this command to run the test with -v (verbose) output: `pytest -v`

**1. Via GitHub Codespaces Environment**
- In the codespace terminal, create a new branch
```
git checkout -b your-branch-name
```
- Make all necessary changes and commit them
```
git add .
git commit -m "Description of changes made"
```
- Push changes to GitHub
```
git push origin your-branch-name
```
- Click on **Create pull request** in the prompt that will be shown

**2. Via GitHub Desktop**
- Fork the repository
- Create a new branch and name it.
- Commit your changes
- Navigate the repository,Click on **Compare & pull request**
- Set the main branch to **master** (name of ersilia repository main branch) and set the compare branch to your-branch-name
- Fill out the title section and give a brief description of any changes made
- Click **Create Pull Request**





11 changes: 11 additions & 0 deletions test/test_compound_identifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest
from ersilia.utils.identifiers.compound import CompoundIdentifier

@pytest.fixture
def compound_identifier():
return CompoundIdentifier()

@pytest.mark.parametrize("header", ["smiles", "input", "SMILES", "INPUT"])
def test_is_input_header_positive(compound_identifier, header):
"""Test that valid input headers return True."""
assert compound_identifier.is_input_header(header) is True

0 comments on commit db9b2e1

Please sign in to comment.