Skip to content

feat: Add NIRData conversion functionalities - #53

Open
benkroehs wants to merge 2 commits into
mainfrom
nirdata
Open

feat: Add NIRData conversion functionalities#53
benkroehs wants to merge 2 commits into
mainfrom
nirdata

Conversation

@benkroehs

Copy link
Copy Markdown
Collaborator

With this PR I propose to add NIRData conversion functionalities to the NIRTorch repo. For many PyTorch-based simulators, the data format does not differ much and they are typically already depending on NIRTorch. Therefore I think it is sensible to add this here. Flexibility is kept by exposing the NIRData API (e.g. dynamic_before_transition or dt)
dt is in units of seconds for NIRData but some simulators may operate in milliseconds, why I added the time_unit argument. Of course one could just convert dt accordingly but this might be a nicer way of doing it. But no hard opinions there.

This PR depends on the most recent NIR PR.

@Jegp Jegp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes. I wonder whether it makes sense to somehow model the relationship between the NIRData object on-par with NIR native objects. See my comment here: neuromorphs/NIR#194

Comment thread tests/test_nir_data.py
import nir
from nirtorch import from_nir_data, to_nir_data
import numpy as np
import torch

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff complaint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants