Skip to content

feat: adds computer to instrument components - #216

Open
jtyoung84 wants to merge 1 commit into
mainfrom
feat-add-computer-component
Open

jtyoung84 wants to merge 1 commit into
mainfrom
feat-add-computer-component

Conversation

@jtyoung84

@jtyoung84 jtyoung84 commented Nov 1, 2026 •

Copy link
Copy Markdown

Summary

Closes https://github.com/AllenNeuralDynamics/DF-Refactoring/issues/228

I added a small method to map a AindDynamicForagingRig to an aind-data-schema Computer object. I followed an example provided here

There doesn't seem to be a similar TrackedDevices enum in the DF repo, so I hard-coded it.

Testing

From root level repo, ran:

uv run ruff format
uv run ruff check
uv run pytest .

There isn't a tests package in the aind_behavior_dynamic_foraging_metadata_mapper directory. It's probably outside the scope of this ticket, but should be added in the future to make development easier.

How to review

Please check that the mapping is correct and will be appended to the components list.

Notes:

  • The issue didn't provide a lot of extra context. I had to guess which repo I needed to make a change in. I think it's this one.

  • It might be more convenient to move these lines:

        dataset = df_foraging_dataset(self._data_path)
        input_schemas = dataset["Behavior"]["InputSchemas"]
        rig = AindDynamicForagingRig.model_validate(input_schemas["Rig"].data)

into the map function and have the _map function look like _map(self, rig: AindDynamicForagingRig) -> Instrument. This should make testing changes a lot easier. The AindDynamicForagingRig object in the root level examples folder could probably be used as test input data.

  • Also, I've been using PR templates in my recent projects, and I found them useful. Maybe consider adding them to this one.

@micahwoodard

Copy link
Copy Markdown
Collaborator

Thanks @jtyoung84 looks good to me! Appreciate your notes, think those are all good points worth implementing

@jtyoung84

Copy link
Copy Markdown
Author

Thanks @jtyoung84 looks good to me! Appreciate your notes, think those are all good points worth implementing

Cool. Let me know if you want me to merge it and which merge type, or if that's something the reviewer usually does on your team.

name="computer",
manufacturer=Organization.AIND,
operating_system=platform(),
serial_number=rig.computer_name,

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.

is rig.computer_name the hostname?

This branch has not been deployed

No deployments
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.

3 participants