Skip to content

Commit

Permalink
[merge] dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonin Blot committed Sep 26, 2024
1 parent 74fb690 commit 8e0043e
Show file tree
Hide file tree
Showing 45 changed files with 1,781 additions and 943 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:

runs-on: ubuntu-latest
environment:
environment:
name: testing
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
}
}
50 changes: 47 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Change log

## v0.4

### Main changes

- New `SequencingData` class to handle sequencing data
- GUI can now be used to add data to flexilims with `flexiznam gui`
- Add a `conda_envs` field in the config file to use in conjuction with `znamutils`
- `get_children` can work with name or id (instead of id only)
- `check_flexilims_issues` can now add missing paths
- `Dataset.from_origin` has a new `extra_attributes` argument to match online datasets
with specific attributes only.
- `delete_recursively` can delete all children of an entity
- Offline mode using downloaded copy of the database

### Minor
- `add_mouse` uploads birth and death dates in a human readable format instead.
- Add `conflicts` argument to `add_mouse` to overwrite existing mice
- `get_entities` does not raise warnings anymore if `name` is specified and `datatype`
is not. This is now supported upstream by `flexilims`
- Clearer error message when mouse info cannot be found in MCMS
- `load_param` can print the file used to read config with the `verbose` flag.

### Bugfixes

- `update_config` actually adds the new fields (i.e. fields that are in the default
config but not the local config) to the config file

## v0.3.11

### Bugfixes

- Fix bugs related to raw_data for projects not in main folder
- Add mouse works with alive animals


## v0.3.10

### Main changes

- Make `update_entity` safer by crashing if reserved fields are used as attributes.

## v0.3.11

### Bugfixes
Expand Down Expand Up @@ -84,6 +125,7 @@ config but not the local config) to the config file
`return_paths=False`
- New `OnixData` class to handle Onix data
- `get_flexilims_session` can now re-use token from a previous session
- Add a GUI module.

### Minor
- More generic `clean_recursively` replaces the `clean_dictionary_recursively`. It
Expand All @@ -92,17 +134,19 @@ config but not the local config) to the config file
- `Dataset.format(mode='yaml')` ensure yaml compatibility. (path to str, tuple to list,
etc...)
- `add_experimental_session` can be done with `parent_id` (or `parent_name`).
- `add_dataset` can add a dataset to a mouse.
- `get_password` syntax changed to match the `add_password` syntax.
- `add_dataset` can add a dataset to a mouse and does not require genealogy.


### Bugfixes
- Fix [#68](https://github.com/znamlab/flexiznam/issues/68). Dataset.format returns
always the path in posix format.
- Fix [#88](https://github.com/znamlab/flexiznam/issues/88). Now make attributes JSON
compatible before uploading to flexilims. This will replace special characters in
attribute names by `_` in the database.
- Fix [[#102](https://github.com/znamlab/flexiznam/issues/102). `add_mouse` now works
- Fix [#102](https://github.com/znamlab/flexiznam/issues/102). `add_mouse` now works
with mice that have special character in their allele.
- `add_recording` and `add_sample` add the value online with the full name (including
genealogy) rather than the short name.

## v0.3.4

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To set up the flexilims and mcms integration, the config file must be edited. Fi
flexiznam config
```

This should create a `~/.flexiznam/config.yml` file. Edit it with your favorite text editor to change `flexilims_username`, `mcms_username` and,
This should create a `~/.flexiznam/config.yml` file. Edit it with your favorite text editor to change `flexilims_username`, `mcms_username` and,
if neeed `data_root`.

You can then add passwords to make it simpler by running (one by one):
Expand Down Expand Up @@ -78,7 +78,7 @@ If you used `pip -e .` to install, updating can be done with:

```
cd flexiznam
git pull
git pull
pip install -e . --upgrade
flexiznam config --update
```
Expand Down
70 changes: 35 additions & 35 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
136 changes: 68 additions & 68 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

sys.path.insert(0, os.path.abspath("../.."))

# -- Project information -----------------------------------------------------

project = "flexiznam"
copyright = "2021, Antonin Blot, Petr Znamenskiy"
author = "Antonin Blot, Petr Znamenskiy"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_click",
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
}


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

sys.path.insert(0, os.path.abspath("../.."))

# -- Project information -----------------------------------------------------

project = "flexiznam"
copyright = "2021, Antonin Blot, Petr Znamenskiy"
author = "Antonin Blot, Petr Znamenskiy"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_click",
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
}


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
2 changes: 1 addition & 1 deletion docs/source/flexiznam.camp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Module contents
:members:
:undoc-members:
:show-inheritance:

flexiznam.camp.sync\_data module
--------------------------------

Expand Down
28 changes: 28 additions & 0 deletions flexiznam/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
exclude: 'conf.py'

# Configuring https://pre-commit.ci/
ci:
autoupdate_schedule: monthly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-toml
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
args: [--extra-keys=metadata.language_info.version metadata.kernelspec.name metadata.kernelspec.display_name]
Loading

0 comments on commit 8e0043e

Please sign in to comment.