Skip to content

Commit

Permalink
Merge pull request #1 from dandi/enh
Browse files Browse the repository at this point in the history
Major refactoring to support more thorough conversion of dandischema pydantic models
  • Loading branch information
candleindark authored Oct 15, 2024
2 parents 4ff48c6 + 9c33b17 commit fdf4828
Show file tree
Hide file tree
Showing 27 changed files with 3,804 additions and 5,052 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
tags:
- '*'
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on:
- macos-latest
- windows-latest
- ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Hatch
uses: pypa/hatch@install

- name: Run tests
run: hatch run test:python -m pytest --numprocesses=logical -s -v tests
env:
# Needed for coveralls:
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

# vim:set et sts=2:
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.idea/

# === Python ===
__pycache__/
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# linkml-model-generator
Translate pydantic-based schemas from python modules to LinkML.
# pydantic2linkml
A tool for translating models expressed in Pydantic to LinkML

### Run
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)

To run the program, use:
-----

```
python3 generate_linkml_from_aind.py --root_module_name="aind_data_schema.models" --output_file="aind.yml"
```
### Sample Run

### Limitations

1. Supports only Pydantic models with maximum of one immediate parent that is a Pydantic model.
```console
pydantic2linkml -o o.yml -l INFO dandischema.models
```
90 changes: 0 additions & 90 deletions generate_linkml_from_aind.py

This file was deleted.

Loading

0 comments on commit fdf4828

Please sign in to comment.