Skip to content

Commit

Permalink
Merge pull request #185 from PainterQubits/develop
Browse files Browse the repository at this point in the history
Merge develop
  • Loading branch information
alexhad6 authored May 8, 2024
2 parents b9ce3fb + 4bbc5e4 commit d7521b6
Show file tree
Hide file tree
Showing 30 changed files with 2,873 additions and 1,281 deletions.
10 changes: 2 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ updates:
directory: "/"
target-branch: "develop"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "America/Los_Angeles"
interval: "monthly"
groups:
github-actions:
patterns: ["*"]
Expand All @@ -16,10 +13,7 @@ updates:
directory: "/"
target-branch: "develop"
schedule:
interval: "weekly"
day: "monday"
time: "04:00"
timezone: "America/Los_Angeles"
interval: "monthly"
groups:
python:
update-types: ["minor", "patch"]
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- develop

env:
POETRY_VERSION: "1.7.1"
POETRY_VERSION: "1.8.3"
MAIN_PYTHON_VERSION: "3.9"
PACKAGE_NAME: "paramdb"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]

env:
POETRY_VERSION: "1.7.1"
POETRY_VERSION: "1.8.3"

jobs:
build:
Expand Down
8 changes: 4 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ build:
python: "3.10"
jobs:
post_create_environment:
- pip install poetry==1.6.1
- poetry config virtualenvs.create false
- pip install poetry==1.8.2
post_install:
- poetry install --without dev
- poetry run python -m ipykernel install --user
# See https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --all-extras --without dev
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry run python -m ipykernel install --user

sphinx:
configuration: docs/conf.py
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- If Pydantic is installed, parameter data classes automatically have Pydantic type
validation enabled.
- Parameter primitives classes `ParamInt`, `ParamFloat`, `ParamBool`, `ParamStr`, and
`ParamNone`.
- Parameter file classes `ParamFile` and `ParamDataFrame`.

### Changed

- All `ParamData` objects now internally track the latest time that they or any of their
children were last updated, which is returned by `ParamData.last_updated`.
- `Param` and `Struct` are combined into a single class `ParamDataclass`.

## [0.11.0] (Jan 31 2024)

### Added
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# ParamDB

<!-- start badges -->

[![PyPI Latest Release](https://img.shields.io/pypi/v/paramdb)](https://pypi.org/project/paramdb/)
[![PyPI Python Versions](https://img.shields.io/pypi/pyversions/paramdb)](https://pypi.org/project/paramdb/)
[![License](https://img.shields.io/pypi/l/paramdb)](https://github.com/PainterQubits/paramdb/blob/main/LICENSE)
[![CI](https://github.com/PainterQubits/paramdb/actions/workflows/ci.yml/badge.svg)](https://github.com/PainterQubits/paramdb/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/github/PainterQubits/paramdb/branch/main/graph/badge.svg?token=PQEJWLBTBK)](https://codecov.io/github/PainterQubits/paramdb)
[![Documentation Status](https://readthedocs.org/projects/paramdb/badge/?version=stable)](https://paramdb.readthedocs.io/en/stable/?badge=stable)

<!-- end badges -->

<!-- start intro -->

Python package for storing and retrieving experiment parameters.
Expand Down
28 changes: 16 additions & 12 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ All of the following can be imported from `paramdb`.

```{eval-rst}
.. autoclass:: ParamData
.. autoclass:: Param
.. autoclass:: Struct
.. autoclass:: ParamInt
.. autoclass:: ParamFloat
.. autoclass:: ParamBool
.. autoclass:: ParamStr
.. autoclass:: ParamNone
.. autoclass:: ParamDataclass
.. autoclass:: ParamFile
.. autoclass:: ParamDataFrame
.. autoclass:: ParamList
:no-members:
.. autoclass:: ParamDict
:no-members:
.. autoclass:: ParentType
:no-members:
.. autoclass:: RootType
:no-members:
```

## Database
Expand All @@ -26,19 +36,13 @@ All of the following can be imported from `paramdb`.
.. autoclass:: CommitEntryWithData
```

## Keys

<!--
Changing the current module to paramdb._keys is necessary in order to show the correct
docstrings.
Changing the current module to paramdb._database is necessary in order to show the correct
docstring.
-->

```{py:currentmodule} paramdb._keys
```

```{eval-rst}
.. py:currentmodule:: paramdb._database
.. autodata:: CLASS_NAME_KEY
.. autodata:: PARAMLIST_ITEMS_KEY
.. autodata:: LAST_UPDATED_KEY
.. py:currentmodule:: paramdb
```
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
# Autodoc options
# See https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration
autodoc_default_options = {"members": True, "member-order": "bysource"}
autodoc_inherit_docstrings = False
autodoc_type_aliases = {
"ConvertibleToInt": "ConvertibleToInt",
"ConvertibleToFloat": "ConvertibleToFloat",
}
# autodoc_inherit_docstrings = False
add_module_names = False


Expand Down
6 changes: 3 additions & 3 deletions docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ the root data type in order for its methods (e.g. {py:meth}`ParamDB.commit`) wor
with type checking. For example:

```{jupyter-execute}
from paramdb import Struct, Param, ParamDB
from paramdb import ParamDataclass, ParamDB
class Root(Struct):
class Root(ParamDataclass):
param: CustomParam
class CustomParam(Param):
class CustomParam(ParamDataclass):
value: float
param_db = ParamDB[Root]("path/to/param.db")
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ParamDB

```{include} ../README.md
:start-after: <!-- start badges -->
:end-before: <!-- end badges -->
```

```{include} ../README.md
:start-after: <!-- start intro -->
:end-before: <!-- end intro -->
Expand Down
Loading

0 comments on commit d7521b6

Please sign in to comment.