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

Main clone #10

Merged
merged 12 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
27 changes: 14 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Python package
name: Run Tests

on:
push:
branches:
- main
- '*'
pull_request:
branches:
- main
Expand All @@ -13,23 +13,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check out the code
# Checkout the repository
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python
# Set up Python version
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.9' # You can change this to your desired Python version

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
python-version: "3.12"

# Install dependencies using requirements.txt
- name: Install dependencies
run: |
poetry install
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run tests
# Run tests
- name: Run tests with pytest
run: |
poetry run pytest # Adjust this command based on your test framework
export PYTHONPATH=$(pwd)
pytest test/
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ htmlcov/
env.yaml
requirements.txt
dist/
.DS_Store
walkthroughs/workflow-Copy1.ipynb
*.DS_Store
myvenv/
108 changes: 103 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ All types of contributions are encouraged and valued. See the [Table of Contents
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Improving The Documentation](#improving-the-documentation)
- [Styleguides](#styleguides)
- [Styleguides](#style-guides)
- [Documentation](#documentation)
- [Dev Environments](#dev-environments)
- [Code Quality](#code-quality)
- [Formatting](#formatting)
- [Linting](#linting)
- [Documentation Style Guide](#documentation-style-guide)
- [Commit Messages](#commit-messages)
- [Join The Project Team](#join-the-project-team)

- [Attribution](#attribution)

## Code of Conduct

Expand Down Expand Up @@ -132,7 +135,102 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/fanzha
- **Explain why this enhancement would be useful** to most pyCellPhenoX users. You may also want to point out the other projects that solved it better and which could serve as inspiration.

<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
## Your first code contribution

We welcome contributions! Follow these steps to contribute:

### 1. Fork, Clone, and Branch
- Fork the repository and clone it to your local machine.

```bash
git clone https://github.com/fanzhanglab/pyCellPhenoX.git
cd pyCellPhenoX
```

Please branch from the `main` branch given we have set up branch protections.
``` bash
git checkout -b your-branch-name
```

### 2. Make Your Changes
- Make sure your code follows the project standards.
- Format your Python code with Black:

``` bash
black your_file.py
```

### 3. Commit and Push
Commit your changes with a meaningful message:

```bash
git commit -m "Description of your changes"
```

Push your changes:

``` bash
git push origin your-branch-name
```
### 4. Submit a Pull Request
Submit a pull request and explain the changes you've made.


## Style Guides

### Documentation

We use [sphinx](https://www.sphinx-doc.org/en/master/index.html) for autodocumentation of docstrings, using the [napoleon extenstion](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html) to parse [NumPy style docstrings](https://numpydoc.readthedocs.io/en/latest/format.html), implemented with a [furo](https://pradyunsg.me/furo/) theme.
We host our documentation on [readthedocs.org](https://readthedocs.org/) at [https://pyCellPhenoX.readthedocs.io/en/](https://pyCellPhenoX.readthedocs.io/en/).

To build and test changes to the docs locally, run the following command:

```bash
sphinx-build -b html docs build
```

See [`docs/conf.py`](../conf.py) for full documentation configuration.

### Dev environments

#### Local devcontainer

Instructions for setting up a local development environment using VSCode DevContainers:

1. Install [VSCode](https://code.visualstudio.com/download)
2. Install the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension
3. Open the repository in VSCode
4. Click on the green "Reopen in Container" button in the lower left corner of the window
5. Wait for the container to build and install the required dependencies

## Code Quality

Please follow the below quality guides to the best of your abilities.
If you have configured your [dev environment](#dev-environments) as described above, the formatting and linting rules will also be enforced automatically using the installed [pre-commit](https://pre-commit.com/) hooks.

### Formatting

We use [black](https://black.readthedocs.io/en/stable/) for formatting Python code, and [prettier](https://prettier.io/) for formatting markdown, json and yaml files.
We include `black` in the poetry dev dependencies so it can be run manually using `black format`
Prettier (which is not python-based) is not included in the poetry dev dependencies, but can be installed and run manually.
Alternately, both `black format` and `prettier` will be run automatically at commit time with the pre-commit hooks installed.

### Linting

For python code linting, we also use [black](https://black.readthedocs.io/en/stable/), which can perform same linting checks as Flake8.
You can use the command `black --check your_file.py` or `black path/to/your/directory` to check for linting errors.
We also include some commented-out rules in that section that we are working towards enabling in the future.
All linting checks will also be run automatically at commit time with the pre-commit hooks as described above.

### Documentation style guide

We use the [numpy documentation style guide](https://numpydoc.readthedocs.io/en/latest/format.html).
When writing markdown documentation, please also ensure that each sentence is on a new line.

### Commit messages

pyCellPhenoX uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard for commit messages to aid in automatic changelog generation.
We prepare commit messages that follow this standard using [commitizen](https://commitizen-tools.github.io/commitizen/), which comes with the poetry dev dependencies.

## Attribution
This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
68 changes: 8 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyCellPhenoX

<p>
<img height="270" align="centre" src="https://github.com/fanzhanglab/pyCellPhenoX/blob/main/logo/cellphenoX_logo_banner.png">
Expand Down Expand Up @@ -38,7 +39,7 @@ conda install -c conda-forge pyCellPhenoX
git clone [email protected]:fanzhanglab/pyCellPhenoX.git
```

### Dependencies/ Requirements
### Dependencies / Requirements
When using pyCellPhenoX please ensure you are using the following dependency versions or requirements
``` python
python = "^3.9"
Expand All @@ -51,60 +52,6 @@ scikit-learn = "^1.5.2"
matplotlib = "^3.9.2"
statsmodels = "^0.14.3"
```
To check if you have the right depenencies please run the following:
#### Check Python Version
``` bash
python --version
```

#### Check individual package versions
``` bash
pip show {package} | grep Version
```
> Replace {package} with the name of the package you want to check (e.g., pandas, numpy, etc.). This will display the installed version of the package.

### Virtual Environment

If any of the versions are not compatible with your working environment, please set up a virtual environment using one of the following methods: **conda/mamba**, **pip**, or **poetry**.

#### Conda and Mamba

To create a virtual environment using **conda** or **mamba**, follow these steps:

1. **Create the environment:**
```bash
conda create --name {name_the_environment}
```
2. **Activate the environment:**
```bash
conda activate {name_the_environment}
```
3. **Install the requirements.txt:**
```bash
conda install -f requirements.txt
```

#### PIP
To create a virtual environment using **PIP** follow these steps:

1. **Create the environment:**
```bash
python -m venv {name_the_environment}
```
2. **Activate the environment:**
- on Windows
```bash
{name_the_environment}\Scripts\activate
```
- on macOS
```bash
source {name_the_environment}\bin\activate
```
3. **Install the requirements.txt:**
```bash
pip install -r requirements.txt
```


## Tutorials
Please see the [Command-line Reference] for details. Additonally, please see [Walkthroughs] on the documentation page.
Expand All @@ -125,16 +72,16 @@ Additional major functions associated with pyCellPhenoX are:
Each function has uniqure arguments, see our [documentation] for more information

## Usage
- TODO
For more information please see [Walkthrough](walkthroughs/workflow.ipynb) or [Workflow Documentation]

## License
Distributed under the terms of the [MIT license][license],
_pyCellPhenoX_ is free and open source software.

## Code of Conduct
### Code of Conduct
For more information please see [Code of Conduct](CODE_OF_CONDUCT.md) or [Code of Conduct Documentation]

## Contributing
### Contributing
For more information please see [Contributing](CONTRIBUTING.md) or [Contributing Documentation]

## Issues
Expand Down Expand Up @@ -167,8 +114,8 @@ or
```

## Contact
Please contact [[email protected]]([email protected]) for
further questions or protential collaborative opportunities!
Please contact [[email protected]](mailto:[email protected]) for
further questions or potential collaborative opportunities!

<!-- github-only -->

Expand All @@ -182,3 +129,4 @@ further questions or protential collaborative opportunities!
[documentation]: https://pyCellPhenoXreadthedocs.io/
[Code of Conduct Documentation]: https://pyCellPhenoXreadthedocs.io/code_of_conduct
[Contributing Documentation]: https://pyCellPhenoXreadthedocs.io/contributing
[Workflow Documentation]: https://pyCellPhenoXreadthedocs.io/walkthroughs/workflows
4 changes: 4 additions & 0 deletions build/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 752896d6acf2089b607d9cda8b02be6b
tags: 645f666f9bcd5a90fca523b33c5a78b7
4 changes: 4 additions & 0 deletions build/.buildinfo.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 15f57f3ca10b6230b4abc06d59abc2dc
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added build/.doctrees/README.doctree
Binary file not shown.
Binary file added build/.doctrees/api_reference.doctree
Binary file not shown.
Binary file added build/.doctrees/changelog.doctree
Binary file not shown.
Binary file added build/.doctrees/citation.doctree
Binary file not shown.
Binary file added build/.doctrees/code_of_conduct.doctree
Binary file not shown.
Binary file added build/.doctrees/contributing.doctree
Binary file not shown.
Binary file added build/.doctrees/environment.pickle
Binary file not shown.
Binary file added build/.doctrees/index.doctree
Binary file not shown.
Binary file added build/.doctrees/installation.doctree
Binary file not shown.
Binary file added build/.doctrees/issues.doctree
Binary file not shown.
Binary file added build/.doctrees/license.doctree
Binary file not shown.
Binary file added build/.doctrees/modules.doctree
Binary file not shown.
Loading
Loading