Skip to content
Open
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
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,39 @@ The design goals are to have:
- Minimizes *a priori* knowledge that is needed of the internal heirarchical structure, reducing friction for users to load data.
- Transparently return both raw and processed data, where the levels of post-processing can be selected by the user.

To install,
## Installation

### Using pip
To install using pip:
```bash
pip install git+https://github.com/OpenQuantumDesign/oqd-dataschema.git
```

### Using Nix

If you have Nix package manager with flakes enabled, you can install and use this package directly from the repository:

```bash
# Run in a development shell
nix develop github:OpenQuantumDesign/oqd-dataschema

# Or install the package
nix profile install github:OpenQuantumDesign/oqd-dataschema
```

#### Development Environment

For development, clone the repository and use the provided development shell:

```bash
git clone https://github.com/OpenQuantumDesign/oqd-dataschema.git
cd oqd-dataschema
nix develop
```

This will provide you with a complete development environment including:
- All runtime dependencies (pydantic, h5py, bidict)
- Development tools (black, ruff, mypy)
- Documentation tools (mkdocs with required extensions)

The development shell automatically sets up your PYTHONPATH and provides all necessary tools to build, test, and document the project.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
description = "OpenQuantum Design Data Schema";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python311;
pythonPackages = python.pkgs;
in
{
packages.default = pythonPackages.callPackage ./pkgs/derivation.nix { };

devShells.default = pkgs.mkShell {
packages = with pkgs; [
# Python with dependencies
(python.withPackages (ps: with ps; [
# Core dependencies
pydantic
h5py
bidict

# Documentation dependencies
pymdown-extensions
mkdocstrings
mkdocs-material
mkdocstrings-python
mdx-truly-sane-lists

# Test dependencies
pytest

# Development tools
pip
black
ruff
mypy
]))

# Additional development tools
git
];

shellHook = ''
export PYTHONPATH="$PWD/src:$PYTHONPATH"
echo "OpenQuantum Design Data Schema development environment"
echo "Python version: $(python --version)"
'';
};
}
);
}
64 changes: 64 additions & 0 deletions pkgs/derivation.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{ lib
, buildPythonPackage
, pythonOlder
, pydantic
, h5py
, bidict
, pytest
, pymdown-extensions
, mkdocstrings
, mkdocs-material
, mkdocstrings-python
, mdx-truly-sane-lists
}:

buildPythonPackage rec {
pname = "oqd-dataschema";
version = "0.1.0";
format = "pyproject";

disabled = pythonOlder "3.10";

src = ./..;

propagatedBuildInputs = [
pydantic
h5py
bidict
];

checkInputs = [
pytest
];

nativeBuildInputs = [
pymdown-extensions
mkdocstrings
mkdocs-material
mkdocstrings-python
mdx-truly-sane-lists
];

pythonImportsCheck = [ "oqd_dataschema" ];

meta = with lib; {
description = "OpenQuantum Design Data Schema";
homepage = "https://github.com/OpenQuantumDesign/oqd-dataschema";
license = licenses.asl20;
maintainers = with maintainers; [ ];
};
}
Loading