Skip to content

Commit a42cd0d

Browse files
authored
Merge branch 'develop' into add-extra-foundation-models
2 parents b8192e4 + 9021b57 commit a42cd0d

File tree

6 files changed

+180
-208
lines changed

6 files changed

+180
-208
lines changed

CONTRIBUTING.rst

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.. highlight:: shell
22

3-
============
3+
=============
44
Contributing
5-
============
5+
=============
66

7-
Contributions are welcome, and they are greatly appreciated! Every little bit
8-
helps, and credit will always be given.
7+
Contributions are welcome and greatly appreciated! Every little bit helps, and credit will always be given.
98

109
You can contribute in many ways:
1110

@@ -26,21 +25,17 @@ If you are reporting a bug, please include:
2625
Fix Bugs
2726
~~~~~~~~
2827

29-
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30-
wanted" is open to whoever wants to implement it.
28+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
3129

3230
Implement Features
3331
~~~~~~~~~~~~~~~~~~
3432

35-
Look through the GitHub issues for features. Anything tagged with "enhancement"
36-
and "help wanted" is open to whoever wants to implement it.
33+
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
3734

3835
Write Documentation
3936
~~~~~~~~~~~~~~~~~~~
4037

41-
TIA Toolbox could always use more documentation, whether as part of the
42-
official TIA Toolbox docs, in docstrings, or even on the web in blog posts,
43-
articles, and such.
38+
TIA Toolbox could always use more documentation, whether as part of the official TIA Toolbox docs, in docstrings, or even on the web in blog posts, articles, and such.
4439

4540
Submit Feedback
4641
~~~~~~~~~~~~~~~
@@ -50,9 +45,8 @@ The best way to send feedback is to file an issue at https://github.com/TissueIm
5045
If you are proposing a feature:
5146

5247
* Explain in detail how it would work.
53-
* Keep the scope as narrow as possible, to make it easier to implement.
54-
* Remember that this is a volunteer-driven project, and that contributions
55-
are welcome :)
48+
* Keep the scope as narrow as possible to make it easier to implement.
49+
* Remember that this is a volunteer-driven project, and contributions are welcome :)
5650

5751
Get Started!
5852
------------
@@ -64,7 +58,7 @@ Ready to contribute? Here's how to set up ``tiatoolbox`` for local development.
6458

6559
$ git clone [email protected]:your_name_here/tiatoolbox.git
6660

67-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
61+
3. Install your local copy into a virtual environment. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
6862

6963
$ mkvirtualenv tiatoolbox
7064
$ cd tiatoolbox/
@@ -76,13 +70,18 @@ Ready to contribute? Here's how to set up ``tiatoolbox`` for local development.
7670

7771
Now you can make your changes locally.
7872

79-
5. When you're done making changes, check that your changes pass flake8 and the
80-
tests::
73+
5. When you're done making changes, check that your changes pass pre-commit and the tests::
8174

82-
$ flake8 tiatoolbox tests
75+
$ pre-commit run --all-files
8376
$ python setup.py test or pytest
8477

85-
To get flake8, just pip install them into your virtualenv.
78+
To get `pre-commit <https://pre-commit.com/#install>`_, just pip install it into your virtual environment using::
79+
80+
$ pip install pre-commit
81+
82+
To set up the git hook for pre-commit, run the following command after installing pre-commit::
83+
84+
$ pre-commit install
8685

8786
6. Commit your changes and push your branch to GitHub::
8887

@@ -98,20 +97,15 @@ Pull Request Guidelines
9897
Before you submit a pull request, check that it meets these guidelines:
9998

10099
1. The pull request should include tests.
101-
2. If the pull request adds functionality, the docs should be updated. Put
102-
your new functionality into a function with a docstring, and add the
103-
feature to the list in README.rst.
104-
3. The pull request should work for Python 3.8, 3.9 and 3.10, and for PyPy. Check
105-
https://travis-ci.com/tialab/tiatoolbox/pull_requests
106-
and make sure that the tests pass for all supported Python versions.
100+
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the pull request description.
101+
3. The pull request should work for Python 3.9, 3.10, 3.11, and 3.12, and for PyPy. Check https://github.com/TissueImageAnalytics/tiatoolbox/actions/workflows/python-package.yml and make sure that the tests pass for all supported Python versions.
107102

108103
Tips
109104
----
110105

111106
To run a subset of tests::
112107

113-
$ pytest tests.test_tiatoolbox
114-
108+
$ pytest tests.test_tiatoolbox
115109

116110
Deploying
117111
---------
@@ -120,8 +114,8 @@ A reminder for the maintainers on how to deploy.
120114
Make sure all your changes are committed (including an entry in HISTORY.rst).
121115
Then run::
122116

123-
$ poetry version patch # use: "poetry version --help" for other options
124-
$ git push
125-
$ git push --tags
117+
$ poetry version patch # use: "poetry version --help" for other options
118+
$ git push
119+
$ git push --tags
126120

127-
Travis will then deploy to PyPI if tests pass.
121+
GitHub Actions will then deploy to PyPI if tests pass.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ or
126126

127127
### License
128128

129-
The source code TIA Toolbox (tiatoolbox) as hosted on GitHub is released under the [BSD-3-Clause license](https://github.com/TissueImageAnalytics/tiatoolbox/blob/develop/LICENSE). The full text of the licence is included in [LICENSE](https://raw.githubusercontent.com/TissueImageAnalytics/tiatoolbox/develop/LICENSE).
129+
The source code TIAToolbox (tiatoolbox) as hosted on GitHub is released under the [BSD-3-Clause license](https://github.com/TissueImageAnalytics/tiatoolbox/blob/develop/LICENSE). The full text of the licence is included in [LICENSE](https://raw.githubusercontent.com/TissueImageAnalytics/tiatoolbox/develop/LICENSE).
130130

131131
Models weights are dependent on the datasets that they were trained on. Please refer to the [documentation](https://tia-toolbox.readthedocs.io/en/latest/pretrained.html) for more details.
132132

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ def all_but_ipynb(dir_path, contents):
20162016
# Replace the target string
20172017
file_data = file_data.replace(".rst", ".html")
20182018
file_data = file_data.replace(".ipynb", ".html")
2019-
file_data = file_data.replace("](./", "](./jnb/")
2019+
file_data = file_data.replace("](./", "](./_notebooks/jnb/")
20202020
file_data = file_data.replace("../docs/", "./")
20212021

20222022
# Write the file out again

docs/installation.rst

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,26 @@ Installation
77

88
Prerequisites
99
=============
10-
The prerequisites for tiatoolbox installation are OpenSlide binaries and OpenJpeg version 2.3.0 or above.
11-
Please follow the instructions below to install prerequisite software according to the platform you are using.
10+
11+
The prerequisites for TIAToolbox installation are OpenSlide binaries and OpenJPEG version 2.3.0 or above. Please follow the instructions below to install the prerequisite software according to your platform.
1212

1313
Linux (Ubuntu)
1414
--------------
15-
On Linux the prerequisite software can be installed using the command
15+
16+
On Linux, the prerequisite software can be installed using the following command:
1617

1718
.. code-block:: console
1819
1920
$ apt-get -y install libopenjp2-7-dev libopenjp2-tools openslide-tools
2021
21-
The same command is used when working on the Colab or Kaggle platforms.
22-
When working on Google Colab, we remove the packages ``datascience`` and ``albumentations`` because they conflict
23-
and produce an error message.
22+
The same command is used when working on the Colab or Kaggle platforms. When working on Google Colab, we remove the packages ``datascience`` and ``albumentations`` because they conflict and produce an error message.
2423

2524
Windows (10+)
26-
-------------------
27-
1. Download OpenSlide binaries from `this page <https://openslide.org/download/>`_. Extract the folder and add ``bin`` and ``lib`` subdirectories to
28-
Windows `system path <https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)>`_. If you are using a conda environment you can also copy ``bin`` and ``lib`` subdirectories to ``[Anaconda Installation Path]/envs/[tiatoolbox-environment]/Library/``.
25+
-------------
2926

30-
2. Install OpenJPEG. The easiest way is to install OpenJpeg is through conda
31-
using
27+
1. Download OpenSlide binaries from `this page <https://openslide.org/download/>`_. Extract the folder and add the ``bin`` and ``lib`` subdirectories to the Windows `system path <https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14)>`_. If you are using a conda environment, you can also copy the ``bin`` and ``lib`` subdirectories to ``[Anaconda Installation Path]/envs/[tiatoolbox-environment]/Library/``.
28+
29+
2. Install OpenJPEG. The easiest way to install OpenJPEG is through conda:
3230

3331
.. code-block:: console
3432
@@ -37,7 +35,7 @@ using
3735
macOS
3836
-----
3937

40-
On macOS there are two popular package managers, `homebrew`_ and `macports`_.
38+
On macOS, there are two popular package managers, `homebrew`_ and `macports`_.
4139

4240
.. _homebrew: https://brew.sh/
4341
.. _macports: https://www.macports.org/
@@ -56,26 +54,26 @@ MacPorts
5654
5755
$ port install openjpeg openslide
5856
59-
6057
Installing Stable Release
6158
=========================
6259

63-
Please note that TIAToolbox is tested for python version 3.9, 3.10, 3.11 and 3.12.
60+
Please note that TIAToolbox is tested for Python versions 3.9, 3.10, 3.11, and 3.12.
6461

6562
Recommended
6663
-----------
64+
6765
To install TIAToolbox, run this command in your terminal after you have installed the prerequisite software:
6866

6967
.. code-block:: console
7068
7169
$ pip install tiatoolbox
7270
73-
This is the preferred method to install TIA Toolbox, as it will always install the most recent stable release.
71+
This is the preferred method to install TIAToolbox, as it will always install the most recent stable release.
7472

7573
Upgrade
7674
-------
7775

78-
To upgrade an existing version of tiatoolbox to the latest stable release, run this command in your terminal:
76+
To upgrade an existing version of TIAToolbox to the latest stable release, run this command in your terminal:
7977

8078
.. code-block:: console
8179
@@ -84,21 +82,19 @@ To upgrade an existing version of tiatoolbox to the latest stable release, run t
8482
Without Dependencies
8583
--------------------
8684

87-
If you already have setup a Python environment with all the pre-requisite software and dependencies installed and you would like to keep the existing versions of these dependencies, run this command in your terminal:
85+
If you already have a Python environment set up with all the prerequisite software and dependencies installed and you would like to keep the existing versions of these dependencies, run this command in your terminal:
8886

8987
.. code-block:: console
9088
9189
$ pip install --no-deps tiatoolbox
9290
93-
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
94-
you through the process.
91+
If you don't have `pip`_ installed, this `Python installation guide`_ can guide you through the process.
9592

9693
.. _pip: https://pip.pypa.io
9794
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
9895

99-
100-
Alternative Method(s)
101-
=====================
96+
Alternative Methods
97+
===================
10298

10399
Using Anaconda
104100
--------------
@@ -115,13 +111,12 @@ or
115111
116112
$ mamba install tiatoolbox
117113
114+
Please note that conda-forge installation support is limited on Windows as OpenSlide binaries are not supported on official conda channels. An alternate way to install using conda on Windows could be to install it in `WSL2 with CUDA support <https://docs.microsoft.com/en-us/windows/ai/directml/gpu-cuda-in-wsl>`_. In some cases, WSL2 runs faster on Python code, and therefore we **recommend** this option.
118115

119-
Please note that conda-forge installation support is limited on Windows as openslide binaries are not supported on official conda channels. An alternate way to install using conda on Windows could be to install it in `WSL2 with CUDA support <https://docs.microsoft.com/en-us/windows/ai/directml/gpu-cuda-in-wsl>`_. In some cases, WSL2 runs faster on Python codes and therefore we **recommend** this option.
120-
121-
From sources
116+
From Sources
122117
------------
123118

124-
The sources for TIA Toolbox can be downloaded from the `Github repo`_.
119+
The sources for TIAToolbox can be downloaded from the `GitHub repo`_.
125120

126121
You can either clone the public repository:
127122

@@ -141,69 +136,65 @@ Once you have a copy of the source, you can install it with:
141136
142137
$ python setup.py install
143138
144-
145-
.. _Github repo: https://github.com/TissueImageAnalytics/tiatoolbox.git
139+
.. _GitHub repo: https://github.com/TissueImageAnalytics/tiatoolbox.git
146140
.. _tarball: https://github.com/TissueImageAnalytics/tiatoolbox/tarball/master
147141

148142
Using Docker
149143
------------
150144

151-
To run TIA toolbox in an isolated environment, use our `Docker image <https://github.com/tissueimageanalytics/tiatoolbox-docker/pkgs/container/tiatoolbox>`_ . We host different Dockerfiles in our github repository `tiatoolbox-docker <https://github.com/TissueImageAnalytics/tiatoolbox-docker>`_. Please report any issues related to the docker image in the repository `tiatoolbox-docker <https://github.com/TissueImageAnalytics/tiatoolbox-docker>`_.
145+
To run TIAToolbox in an isolated environment, use our `Docker image <https://github.com/tissueimageanalytics/tiatoolbox-docker/pkgs/container/tiatoolbox>`_. We host different Dockerfiles in our GitHub repository `tiatoolbox-docker <https://github.com/TissueImageAnalytics/tiatoolbox-docker>`_. Please report any issues related to the Docker image in the repository `tiatoolbox-docker <https://github.com/TissueImageAnalytics/tiatoolbox-docker>`_.
152146

153-
After `installing Docker <https://docs.docker.com/get-docker/>`_ (or Docker Desktop), you can use our TIA toolbox image in 3 different ways.
147+
After `installing Docker <https://docs.docker.com/get-docker/>`_ (or Docker Desktop), you can use our TIAToolbox image in three different ways.
154148

155149
Use the Pre-Built Docker Image
156150
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157-
TIAToolbox provides pre-built docker containers which can be downloaded using the instructions below:
158151

159-
1. Pull the Image From Github Container Registry
160-
""""""""""""""""""""""""""""""""""""""""""""""""""""
152+
TIAToolbox provides pre-built Docker containers which can be downloaded using the instructions below:
153+
154+
1. Pull the Image From GitHub Container Registry:
155+
161156
.. code-block:: console
162157
163158
$ docker pull ghcr.io/tissueimageanalytics/tiatoolbox:latest
164159
165-
2. Use the Pre-Built Docker Image as a Base Image in a Dockerfile
166-
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
167-
.. code-block:: console
160+
2. Use the Pre-Built Docker Image as a Base Image in a Dockerfile:
168161

169-
$ FROM ghcr.io/tissueimageanalytics/tiatoolbox:latest
162+
.. code-block:: dockerfile
170163
171-
Build the image locally
164+
FROM ghcr.io/tissueimageanalytics/tiatoolbox:latest
165+
166+
Build the Image Locally
172167
^^^^^^^^^^^^^^^^^^^^^^^
173-
1. Navigate to the Dockerfile that you want to use,
174-
based on the Python version and Operating System that you prefer
175168

176-
2. Build the
177-
Docker image
169+
1. Navigate to the Dockerfile that you want to use, based on the Python version and Operating System that you prefer.
170+
171+
2. Build the Docker image:
178172

179173
.. code-block:: console
180174
181175
$ docker build -t <IMAGE_NAME> .
182176
183-
3. Check that the image
184-
has been created
177+
3. Check that the image has been created:
185178

186179
.. code-block:: console
187180
188181
$ docker images
189182
190-
4. Deploy the image
191-
as a Docker container
183+
4. Deploy the image as a Docker container:
192184

193185
.. code-block:: console
194186
195187
$ docker run -it --rm --name <CONTAINER_NAME> <IMAGE_NAME>
196188
197-
5. Connect to the
198-
running container
189+
5. Connect to the running container:
199190

200191
.. code-block:: console
201192
202193
$ docker exec -it <CONTAINER_NAME> bash
203194
204-
To add your own script and run it through the Docker container, first copy your script into the docker environment and then execute it.
195+
To add your own script and run it through the Docker container, first copy your script into the Docker environment and then execute it:
205196

206-
.. code-block:: console
197+
.. code-block:: dockerfile
207198
208-
$ COPY /path/to/<script>.py .
209-
$ CMD ["python3", "<script>.py"]
199+
COPY /path/to/<script>.py .
200+
CMD ["python3", "<script>.py"]

0 commit comments

Comments
 (0)