BiomedSciAI / fuse-med-ml

A python framework accelerating ML based discovery in the medical field by encouraging code reuse. Batteries included :)
Apache License 2.0
134 stars 34 forks source link

Make `op_id` a really optional argument in `OpCast` #337

Closed SagiPolaczek closed 10 months ago

SagiPolaczek commented 10 months ago

Minor change for a small thing that had annoyed me for a while :)

Note, this doesn't affect the pipelines (static & dynamic), rather working with ops as a mere objects. For example:

from fuse.data import OpToTensor

# Assuming sample_dict is an 'NDict' with a key 'key' 

op = OpToTensor()
op(sample_dict, key="key", op_id=None)   # Must set op_id to some value although it's an optional 
op(sample_dict, key="key")   # After merging this PR :)

Mostly relevant for unit-testing.