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

Allow to specify module for resolving names #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

timotaularson
Copy link
Contributor

@timotaularson timotaularson commented Feb 20, 2019

Add optional parameter to BSON.load function to specify module for resolving names.
Solves #25 other than not updating the @load macro.

@timotaularson timotaularson changed the title Allow to specify module for resolving names Allow to specify module for resolving names, sovles https://github.com/MikeInnes/BSON.jl/issues/25 Feb 20, 2019
@timotaularson timotaularson changed the title Allow to specify module for resolving names, sovles https://github.com/MikeInnes/BSON.jl/issues/25 Allow to specify module for resolving names Feb 20, 2019
@timotaularson timotaularson marked this pull request as ready for review February 20, 2019 20:51
@Datseris
Copy link

Datseris commented Mar 1, 2019

bump. If this solves the problem, shouldn't it be merged?

@timotaularson
Copy link
Contributor Author

timotaularson commented Mar 1, 2019 via email

@Datseris
Copy link

Datseris commented Mar 1, 2019

@MikeInnes

Copy link

@odow odow left a comment

Choose a reason for hiding this comment

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

I just ran into this issue. Also, can we name init something more descriptive like module_scope? init is quite overloaded in terms of definitions.


parse(io::IO) = backrefs!(parse_doc(io))
parse(path::String) = open(parse, path)

load(x) = raise_recursive(parse(x))
load(x, init=Main) = raise_recursive(parse(x), init)
Copy link

Choose a reason for hiding this comment

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

Should this be init=@__MODULE__?

@sandijs-private
Copy link

1 year has passed since the pull request. Maybe this repository should be cloned and made as new, forked project? (If its so dead now)

@darsnack
Copy link
Contributor

darsnack commented Mar 2, 2021

@CarloLucibello @DhairyaLGandhi Can we merge this? It is blocking pre-trained weights from being used in Metalhead without the user loading Zygote in the REPL.

@CarloLucibello
Copy link
Collaborator

yes this would be great to have. Maybe that review comment about a possible switch to init=@__MODULE__ could be ignored so that we don't risk breaking things (although I don't have a clear understanding of the consequences, maybe @__MODULE__ could provide a better default in the future).

Also, having tests would be nice if someone is willing to provide them, otherwise, this should not block the much more important work for Metalhead.

@darsnack
Copy link
Contributor

darsnack commented Mar 2, 2021

@timotaularson Sorry for the long delay. Do you mind adding the tests? Or I can take over and re-submit this PR, but I always like to preserve authorship for the people who take the effort to contribute.

@timotaularson
Copy link
Contributor Author

timotaularson commented Mar 2, 2021 via email

@darsnack darsnack mentioned this pull request Mar 2, 2021
CarloLucibello added a commit that referenced this pull request Mar 7, 2021
@darsnack
Copy link
Contributor

darsnack commented Apr 1, 2021

Closed by #91

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.

6 participants