Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compose parallel rollout #38

Merged
merged 87 commits into from Oct 22, 2021
Merged

Add compose parallel rollout #38

merged 87 commits into from Oct 22, 2021

Conversation

jasonkhadka
Copy link
Member

@jasonkhadka jasonkhadka commented Oct 15, 2021

  • Added compose, parallel, rollout, namedrollout, namedparallel
  • implemented __call__ for these
  • renamed MetaTransforms to CompoundTransforms
  • resolved inheritance issue - all inherit from CompoundTransforms
  • unresolved - module and stack arguments for __init__

Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

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

It looks like some cpython files were added accidentally. Could you remove them and add __pycache__ to the .gitignore?

@sjrl
Copy link
Contributor

sjrl commented Oct 15, 2021

Looking nice and clean!

@jasonkhadka
Copy link
Member Author

It looks like some cpython files were added accidentally. Could you remove them and add __pycache__ to the .gitignore?

removed the files.

@jasonkhadka jasonkhadka requested a review from sjrl October 18, 2021 07:40
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
@sjrl
Copy link
Contributor

sjrl commented Oct 18, 2021

Is it possible to add tests for these functions? Or are they not usable yet?

@jasonkhadka
Copy link
Member Author

jasonkhadka commented Oct 18, 2021

Is it possible to add tests for these functions? Or are they not usable yet?

Yup not usable yet without figuring out module and stack. I guess that has to be inferred either inside CompoudTransform or inside individual Transforms.

@jasonkhadka jasonkhadka requested a review from sjrl October 18, 2021 08:39
sjrl
sjrl previously requested changes Oct 18, 2021
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
lf/lf.py Outdated Show resolved Hide resolved
@jasonkhadka
Copy link
Member Author

jasonkhadka commented Oct 18, 2021

I see an issue with flatten for NamedRollout and NamedParallel, flattening the named entity would result in change of keys and format of namedtuple output. Named* need to have custom _flatten_list
Also should this be the desired result of flattening? What about the key t2?
NamedRollout(t1=t1, t2=(NamedRollout(t2a=t2a,t2b=t2b)) = NamedRollout(t1=t1, t2a=t2a, t2b=t2b)

@wuhu
Copy link
Contributor

wuhu commented Oct 18, 2021

I see an issue with flatten for NamedRollout and NamedParallel, flattening the named entity would result in change of keys and format of namedtuple output. Named* need to have custom _flatten_list Also should this be the desired result of flattening? What about the key t2? NamedRollout(t1=t1, t2=(NamedRollout(t2a=t2a,t2b=t2b)) = NamedRollout(t1=t1, t2a=t2a, t2b=t2b)

hmm it would seem logical to me not to flat those

@sjrl
Copy link
Contributor

sjrl commented Oct 18, 2021

I see an issue with flatten for NamedRollout and NamedParallel, flattening the named entity would result in change of keys and format of namedtuple output. Named* need to have custom _flatten_list Also should this be the desired result of flattening? What about the key t2? NamedRollout(t1=t1, t2=(NamedRollout(t2a=t2a,t2b=t2b)) = NamedRollout(t1=t1, t2a=t2a, t2b=t2b)

hmm it would seem logical to me not to flat those

Does that mean flattening would not work for NamedTuple outputs?

@jasonkhadka
Copy link
Member Author

jasonkhadka commented Oct 18, 2021

I see an issue with flatten for NamedRollout and NamedParallel, flattening the named entity would result in change of keys and format of namedtuple output. Named* need to have custom _flatten_list Also should this be the desired result of flattening? What about the key t2? NamedRollout(t1=t1, t2=(NamedRollout(t2a=t2a,t2b=t2b)) = NamedRollout(t1=t1, t2a=t2a, t2b=t2b)

hmm it would seem logical to me not to flat those

This would mean that we would need to assert flatten=False for Named stuff, or override _flatten_list to do nothing?
Was thinking if other non-named entities passed to Named* could be still be flattened but i think it also does not make sense.
Example :
NamedRollout(t1=t1, t2=NamedRollout(t2a=t2a,t2b=t2b), t3=(t3a / t3b)) = ?

@wuhu wuhu merged commit 4f3a613 into main Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants