Skip to content

Commit b4954f6

Browse files
committed
Merge branch 'dev' into 'main'
Dev See merge request scientific-computing-team/linchemin!44
2 parents f44fda3 + 93aa950 commit b4954f6

File tree

89 files changed

+6483
-4107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+6483
-4107
lines changed

.gitignore

Lines changed: 16 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,30 @@
1-
# Created by .ignore support plugin (hsz.mobi)
2-
### Python template
1+
# Do not delete items from .gitignore
2+
#
3+
34
# Byte-compiled / optimized / DLL files
45
__pycache__/
56
*.py[cod]
6-
*$py.class
7-
8-
# C extensions
9-
*.so
107

118
# Distribution / packaging
12-
.Python
13-
env/
14-
build/
15-
develop-eggs/
16-
dist/
17-
downloads/
18-
eggs/
19-
.eggs/
20-
lib/
21-
lib64/
22-
parts/
23-
sdist/
24-
var/
259
*.egg-info/
26-
.installed.cfg
27-
*.egg
28-
src/*.egg-info/
29-
.pytest_cache
30-
31-
# PyInstaller
32-
# Usually these files are written by a python script from a template
33-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34-
*.manifest
35-
*.spec
36-
37-
# Installer logs
38-
pip-log.txt
39-
pip-delete-this-directory.txt
40-
41-
# Unit test / coverage reports
42-
htmlcov/
43-
.tox/
44-
.coverage
45-
.coverage.*
46-
.cache
47-
nosetests.xml
48-
coverage.xml
49-
*,cover
50-
.hypothesis/
51-
52-
# Translations
53-
*.mo
54-
*.pot
55-
56-
# Django stuff:
57-
*.log
58-
local_settings.py
59-
60-
# Flask stuff:
61-
instance/
62-
.webassets-cache
63-
64-
# Scrapy stuff:
65-
.scrapy
10+
.eggs/
11+
dist/
6612

67-
# Sphinx documentation
68-
docs/_build/
13+
# IDE settings Pycharm/VSCode/Visual Studio
14+
.idea
15+
.vscode
16+
*.sln
6917

70-
# PyBuilder
71-
target/
18+
# pytest
19+
.pytest_cache
7220

7321
# IPython Notebook
7422
.ipynb_checkpoints
7523

76-
# pyenv
77-
.python-version
78-
79-
# celery beat schedule file
80-
celerybeat-schedule
24+
# Docs build
25+
/docs/build/
26+
/docs/source/reference/generated/*rst
8127

82-
# dotenv
28+
# managing secrets
29+
.ini
8330
.env
84-
85-
# virtualenv
86-
venv/
87-
ENV/
88-
89-
# Spyder project settings
90-
.spyderproject
91-
92-
# Rope project settings
93-
.ropeproject
94-
### VirtualEnv template
95-
# Virtualenv
96-
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
97-
.Python
98-
[Bb]in
99-
[Ii]nclude
100-
[Ll]ib
101-
[Ll]ib64
102-
[Ll]ocal
103-
[Ss]cripts
104-
pyvenv.cfg
105-
.venv
106-
pip-selfcheck.json
107-
### JetBrains template
108-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
109-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
110-
111-
# User-specific stuff:
112-
.idea/workspace.xml
113-
.idea/tasks.xml
114-
.idea/dictionaries
115-
.idea/vcs.xml
116-
.idea/jsLibraryMappings.xml
117-
118-
# Sensitive or high-churn files:
119-
.idea/dataSources.ids
120-
.idea/dataSources.xml
121-
.idea/dataSources.local.xml
122-
.idea/sqlDataSources.xml
123-
.idea/dynamic.xml
124-
.idea/uiDesigner.xml
125-
126-
# Gradle:
127-
.idea/gradle.xml
128-
.idea/libraries
129-
130-
# Mongo Explorer plugin:
131-
.idea/mongoSettings.xml
132-
133-
.idea/
134-
135-
## File-based project format:
136-
*.iws
137-
138-
## Plugin-specific files:
139-
140-
# IntelliJ
141-
/out/
142-
143-
# mpeltonen/sbt-idea plugin
144-
.idea_modules/
145-
146-
# JIRA plugin
147-
atlassian-ide-plugin.xml
148-
149-
# Crashlytics plugin (for Android Studio and IntelliJ)
150-
com_crashlytics_export_strings.xml
151-
crashlytics.properties
152-
crashlytics-build.properties
153-
fabric.properties
154-
/linchemin_old/
155-
156-
# Experimental dataset
157-
experiment/small_dataset

CONTRIBUTING.md

Lines changed: 68 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,79 @@
1+
# Contributing
12

2-
# Secret management in development
3+
## Contribution Terms and License
34

4-
# Architecture visualization
5-
pydeps requiring graphviz to be installed (not via pip!)
6-
https://medium.com/illumination/visualize-dependencies-between-python-modules-d6e8e9a92c50
7-
https://pythonawesome.com/python-module-dependency-visualization/
5+
The code and documentation of LinChemIn is contained in this repository. To contribute
6+
to this project or any of the elements of LinChemIn we recommend you start by reading this
7+
contributing guide.
88

9-
> pydeps src/linchemin -o docs/source/_static/linchemin_dependency_diagram.svg
10-
> pydeps src/linchemin -o docs/source/_static//linchemin_dependency_diagram.svg --cluster --max-cluster-size=3 --min-cluster-size=2 --keep-targe
11-
t-cluster
9+
## Contributing to LinChemIn codebase
1210

11+
If you would like to contribute to the package, we recommend the following development setup.
1312

14-
# Keeping track of work
15-
## Use branching while work with featurs/bugs
16-
In your Github fork, you need to keep your master branch clean, by clean I mean without any changes, like that you can create at any time a branch from your master. Each time that you want to commit a bug or a feature, you need to create a branch for it, which will be a copy of your master branch.
13+
1. Create a copy of the [repository](https://github.com/syngenta/linchemin) via the "_Fork_" button.
1714

18-
https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches
15+
2. Clone the linchemin repository:
1916

20-
## Reference issues in your development work
17+
```sh
18+
git clone [email protected]:${GH_ACCOUNT_OR_ORG}/linchemin.git
19+
```
2120

22-
https://support.atlassian.com/jira-software-cloud/docs/reference-issues-in-your-development-work/
21+
3. Add remote linchemin repo as an "upstream" in your local repo, so you can check/update remote changes.
2322

24-
###Branches
25-
Include the issue key at the beginning of the branch name when you create the branch to link it to your Jira issue.
26-
>git checkout -b JRA-123-branch-name
23+
```sh
24+
git remote add upstream [email protected]:syngenta/linchemin.git
25+
```
2726

28-
###Commits
29-
Include the issue key at the beginning of the commit message to link the commit to your Jira issue.
30-
>git commit -m "JRA-123 commit message"
27+
4. Create a dedicated branch:
28+
29+
```sh
30+
cd linchemin
31+
git checkout -b a-super-nice-feature-we-all-need
32+
```
33+
34+
5. Create and activate a dedicated conda environment (any other virtual environment management would work):
35+
36+
```sh
37+
conda env create linchemin
38+
conda activate linchemin
39+
```
40+
41+
6. Install linchemin in editable mode:
42+
43+
```sh
44+
pip install -e .[dev]
45+
```
46+
47+
7. Implement your changes and once you are ready run the tests:
48+
49+
```sh
50+
# this can take quite long
51+
cd linchemin/tests
52+
python -m pytest
53+
```
54+
55+
And add style checks (be aware that running isort might change your files!):
56+
```sh
57+
cd linchemin
58+
# sorting the imports
59+
python -m isort src/linchemin
60+
# checking flake8
61+
python -m flake8 --ignore E501 src/linchemin
62+
```
63+
64+
8. Once the tests and checks passes, but most importantly you are happy with the implemented feature, commit your changes.
65+
66+
```sh
67+
# add the changes
68+
git add
69+
# commit them
70+
git commit -s -m "feat: implementing super nice feature." -m "A feature we all need."
71+
# check upstream changes
72+
git fetch upstream
73+
git rebase upstream/main
74+
# push changes to your fork
75+
git push -u origin a-super-nice-feature-we-all-need
76+
```
77+
78+
9. From your fork, open a pull request via the "_Contribute_" button, the maintainers will be happy to review it.
3179

32-
###Pull requests
33-
Do at least one of the following:
34-
Include a commit in the pull request that has the issue key in the commit message. Note, the commit cannot be a merge commit.
35-
* Include the issue key at the beginning of the pull request title.
36-
* Ensure that the source branch name also includes the issue key at the beginning of the branch name.
37-
* This works by default in connected Bitbucket, GitLab, GitHub, and GitHub Enterprise tools.
38-
If you create the pull request from the development panel in a Jira issue, the issue key is added automatically

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
[![Pypi version](https://img.shields.io/pypi/v/linchemin.svg)](https://pypi.python.org/pypi/linchemin)
44
[![Documentation Status](https://readthedocs.org/projects/linchemin/badge/?version=latest)](https://linchemin.readthedocs.io/en/latest/?badge=latest)
55
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6+
[![Downloads](https://static.pepy.tech/personalized-badge/linchemin?period=month&units=international_system&left_color=black&right_color=orange&left_text=downloads/mont)](https://pepy.tech/project/linchemin) [![Downloads](https://static.pepy.tech/personalized-badge/linchemin?period=total&units=international_system&left_color=black&right_color=orange&left_text=downloads)](https://pepy.tech/project/linchemin)
7+
[![Contributions](https://img.shields.io/badge/contributions-welcome-blue)](https://github.com/syngenta/linchemin/blob/main/CONTRIBUTING.md)
8+
9+
<img src="./docs/source/static/linchemin_logo.png" alt="logo" width="313">
610

711
## LinChemIn (Linked Chemical Information)
812

@@ -35,6 +39,20 @@ The Linked Chemical Information (LinChemIn) package is a python toolkit that all
3539
## Install for development
3640
>git clone https://github.com/syngenta/linchemin
3741
>cd linchemin
38-
>pip install -e .[development]
42+
>pip install -e .[dev]
3943
4044
Testing is based on pytest
45+
46+
47+
## Configuration
48+
49+
This package requires some configuration parameters to work,
50+
including some secretes to store access credentials to database and services.
51+
After installation, and before the first usage, the use should run the following command
52+
53+
>linchemin_configure
54+
55+
his command generates the user_home/linchemin directory and places into it two files:
56+
1. settings.toml populated with defaults settings. The user can review and modify these values if necessary.
57+
2. .secrets.toml containing the keys for the necessary secrets. The user must replace the placeholders with the correct values
58+
For more details please refer to the Configuration section of the documentation

docs/source/Configuration.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Configuration
2+
====================
3+
4+
.. automodule:: linchemin.configuration.config
5+
:noindex:
6+
7+
8+
9+

docs/source/Installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ LinChemIn requires python 3.9 or higher, as well as some common and reliable thi
66

77
Usage installation
88
--------------------
9-
Install directly from pypi
9+
LinChemIn can be installed directly from pypi
1010

1111
.. code-block:: console
1212
1313
$ pip install linchemin
1414
1515
16-
After cloning the LinChemIn repository from git, you can use ``pip`` to install it:
16+
As an alternative, you can clone the LinChemIn repository from git and then use ``pip`` to install it:
1717

1818
.. code-block:: console
1919

0 commit comments

Comments
 (0)