Hi all,
The method for adding derived fields has somewhat changed in the unitrefactor of 3.0, and we have the opportunity to make it a bit easier to add new fields -- especially after a parameter file has been created, which previously has been a pain. Below is a brief summary.
The current way we do this is with:
add_field(...)
or
@derived_field def some_function(...
The field system is now plugin based, which means we load plugins for different things and fields are dynamically added. One big advantage is that logic for things like strides and whatnot doesn't need to happen inside the field functions, but it also provides some compartmentalization of things.
I haven't implemented @derived_field and add_field yet in this system, but my plan is to do so by creating a "custom" plugin, to which these will add field definitions, which will always get loaded. But if you do:
pf = ... pf.h.whatever...
@derived_field def func(...)...
currently, and in the proposed implementation, this will not let them be detected. But I want to make it so that we can do this:
pf.add_field( ... ) and @pf.derived_field, which will both dynamically add fields to existing parameter files. What this means:
I'm going to be implementing the uncontroversial part of this, which is the dynamic field adding to a "custom" plugin, and unless I hear otherwise I'll continue on this track with the dynamic pf field addition.
-Matt
I think I have a use case that this design might make more difficult.
Let's say I'm adding new fields to an existing code for some reason (like radiation, chemistry, or MHD). I'd like to make it so users can read in my fields with yt and then make derived fields of their own using my fields.
Under your proposal, would I need to modify the yt source to be able to read the fields in properly and assign them units? If so, that seems a bit awkward to me since there would need to be upstream changes to yt that only make sense relative to someone's private fork of a hydro code.
On Thu, Jan 23, 2014 at 1:34 PM, Matthew Turk matthewturk@gmail.com wrote:
Hi all,
The method for adding derived fields has somewhat changed in the unitrefactor of 3.0, and we have the opportunity to make it a bit easier to add new fields -- especially after a parameter file has been created, which previously has been a pain. Below is a brief summary.
The current way we do this is with:
add_field(...)
or
@derived_field def some_function(...
The field system is now plugin based, which means we load plugins for different things and fields are dynamically added. One big advantage is that logic for things like strides and whatnot doesn't need to happen inside the field functions, but it also provides some compartmentalization of things.
I haven't implemented @derived_field and add_field yet in this system, but my plan is to do so by creating a "custom" plugin, to which these will add field definitions, which will always get loaded. But if you do:
pf = ... pf.h.whatever...
@derived_field def func(...)...
currently, and in the proposed implementation, this will not let them be detected. But I want to make it so that we can do this:
pf.add_field( ... ) and @pf.derived_field, which will both dynamically add fields to existing parameter files. What this means:
I'm going to be implementing the uncontroversial part of this, which is the dynamic field adding to a "custom" plugin, and unless I hear otherwise I'll continue on this track with the dynamic pf field addition.
-Matt
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
On Thu, Jan 23, 2014 at 5:13 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
I think I have a use case that this design might make more difficult.
Let's say I'm adding new fields to an existing code for some reason (like radiation, chemistry, or MHD). I'd like to make it so users can read in my fields with yt and then make derived fields of their own using my fields.
Yes, that's an ideal use case we need to support.
>
Under your proposal, would I need to modify the yt source to be able to read the fields in properly and assign them units? If so, that seems a bit awkward to me since there would need to be upstream changes to yt that only make sense relative to someone's private fork of a hydro code.
Hmm, reading in units for a field that yt does not know about, that is actually an outstanding problem with units that predates my changes to the field system. I don't know what to do about it.
> >
On Thu, Jan 23, 2014 at 1:34 PM, Matthew Turk matthewturk@gmail.com wrote: >
Hi all,
The method for adding derived fields has somewhat changed in the unitrefactor of 3.0, and we have the opportunity to make it a bit easier to add new fields -- especially after a parameter file has been created, which previously has been a pain. Below is a brief summary.
The current way we do this is with:
add_field(...)
or
@derived_field def some_function(...
The field system is now plugin based, which means we load plugins for different things and fields are dynamically added. One big advantage is that logic for things like strides and whatnot doesn't need to happen inside the field functions, but it also provides some compartmentalization of things.
I haven't implemented @derived_field and add_field yet in this system, but my plan is to do so by creating a "custom" plugin, to which these will add field definitions, which will always get loaded. But if you do:
pf = ... pf.h.whatever...
@derived_field def func(...)...
currently, and in the proposed implementation, this will not let them be detected. But I want to make it so that we can do this:
pf.add_field( ... ) and @pf.derived_field, which will both dynamically add fields to existing parameter files. What this means:
I'm going to be implementing the uncontroversial part of this, which is the dynamic field adding to a "custom" plugin, and unless I hear otherwise I'll continue on this track with the dynamic pf field addition.
-Matt
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
Yes, I think it would be impossible or at least very hard to support that in general.
In the current system, the user can specify the field units in the add_enzo_field call (for example). Right now a user can do that in a plugin file or the top of a script. Would something similar be possible in the new system?
On Thu, Jan 23, 2014 at 2:23 PM, Matthew Turk matthewturk@gmail.com wrote:
On Thu, Jan 23, 2014 at 5:13 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
I think I have a use case that this design might make more difficult.
Let's say I'm adding new fields to an existing code for some reason (like radiation, chemistry, or MHD). I'd like to make it so users can read in my fields with yt and then make derived fields of their own using my fields.
Yes, that's an ideal use case we need to support.
>
Under your proposal, would I need to modify the yt source to be able to read the fields in properly and assign them units? If so, that seems a bit awkward to me since there would need to be upstream changes to yt that only make sense relative to someone's private fork of a hydro code.
Hmm, reading in units for a field that yt does not know about, that is actually an outstanding problem with units that predates my changes to the field system. I don't know what to do about it.
> >
On Thu, Jan 23, 2014 at 1:34 PM, Matthew Turk matthewturk@gmail.com wrote: >
Hi all,
The method for adding derived fields has somewhat changed in the unitrefactor of 3.0, and we have the opportunity to make it a bit easier to add new fields -- especially after a parameter file has been created, which previously has been a pain. Below is a brief summary.
The current way we do this is with:
add_field(...)
or
@derived_field def some_function(...
The field system is now plugin based, which means we load plugins for different things and fields are dynamically added. One big advantage is that logic for things like strides and whatnot doesn't need to happen inside the field functions, but it also provides some compartmentalization of things.
I haven't implemented @derived_field and add_field yet in this system, but my plan is to do so by creating a "custom" plugin, to which these will add field definitions, which will always get loaded. But if you do:
pf = ... pf.h.whatever...
@derived_field def func(...)...
currently, and in the proposed implementation, this will not let them be detected. But I want to make it so that we can do this:
pf.add_field( ... ) and @pf.derived_field, which will both dynamically add fields to existing parameter files. What this means:
I'm going to be implementing the uncontroversial part of this, which is the dynamic field adding to a "custom" plugin, and unless I hear otherwise I'll continue on this track with the dynamic pf field addition.
-Matt
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
On Jan 23, 2014 5:36 PM, "Nathan Goldbaum" nathan12343@gmail.com wrote: >
Yes, I think it would be impossible or at least very hard to support that in general.
In the current system, the user can specify the field units in the add_enzo_field call (for example). Right now a user can do that in a plugin file or the top of a script. Would something similar be possible in the new system?
Yes.
>
On Thu, Jan 23, 2014 at 2:23 PM, Matthew Turk matthewturk@gmail.com wrote: >
On Thu, Jan 23, 2014 at 5:13 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
I think I have a use case that this design might make more difficult.
Let's say I'm adding new fields to an existing code for some reason (like radiation, chemistry, or MHD). I'd like to make it so users can read in my fields with yt and then make derived fields of their own using my fields.
Yes, that's an ideal use case we need to support.
>
Under your proposal, would I need to modify the yt source to be able to read the fields in properly and assign them units? If so, that seems a bit awkward to me since there would need to be upstream changes to yt that only make sense relative to someone's private fork of a hydro code.
Hmm, reading in units for a field that yt does not know about, that is actually an outstanding problem with units that predates my changes to the field system. I don't know what to do about it.
> >
On Thu, Jan 23, 2014 at 1:34 PM, Matthew Turk matthewturk@gmail.com wrote: >
Hi all,
The method for adding derived fields has somewhat changed in the unitrefactor of 3.0, and we have the opportunity to make it a bit easier to add new fields -- especially after a parameter file has been created, which previously has been a pain. Below is a brief summary.
The current way we do this is with:
add_field(...)
or
@derived_field def some_function(...
The field system is now plugin based, which means we load plugins for different things and fields are dynamically added. One big advantage is that logic for things like strides and whatnot doesn't need to happen inside the field functions, but it also provides some compartmentalization of things.
I haven't implemented @derived_field and add_field yet in this system, but my plan is to do so by creating a "custom" plugin, to which these will add field definitions, which will always get loaded. But if you do:
pf = ... pf.h.whatever...
@derived_field def func(...)...
currently, and in the proposed implementation, this will not let them be detected. But I want to make it so that we can do this:
pf.add_field( ... ) and @pf.derived_field, which will both dynamically add fields to existing parameter files. What this means:
I'm going to be implementing the uncontroversial part of this, which is the dynamic field adding to a "custom" plugin, and unless I hear otherwise I'll continue on this track with the dynamic pf field addition.
-Matt
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
On Jan 23, 2014 5:39 PM, "Matthew Turk" matthewturk@gmail.com wrote: > >
On Jan 23, 2014 5:36 PM, "Nathan Goldbaum" nathan12343@gmail.com wrote: >
Yes, I think it would be impossible or at least very hard to support that in general.
In the current system, the user can specify the field units in the add_enzo_field call (for example). Right now a user can do that in a plugin file or the top of a script. Would something similar be possible in the new system?
Yes.
Sorry for replying again too quickly, but this brought up the (obvious in retrospect) possibility of using plugins for frontend-specific fields. So maybe we don't need to worry about this at all, and I shouldn't have written!
[bikeshed joke here]
>
>
On Thu, Jan 23, 2014 at 2:23 PM, Matthew Turk matthewturk@gmail.com wrote: >
On Thu, Jan 23, 2014 at 5:13 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
I think I have a use case that this design might make more difficult.
Let's say I'm adding new fields to an existing code for some reason (like radiation, chemistry, or MHD). I'd like to make it so users can read in my fields with yt and then make derived fields of their own using my fields.
Yes, that's an ideal use case we need to support.
>
Under your proposal, would I need to modify the yt source to be able to read the fields in properly and assign them units? If so, that seems a bit awkward to me since there would need to be upstream changes to yt that only make sense relative to someone's private fork of a hydro code.
Hmm, reading in units for a field that yt does not know about, that is actually an outstanding problem with units that predates my changes to the field system. I don't know what to do about it.
> >
On Thu, Jan 23, 2014 at 1:34 PM, Matthew Turk matthewturk@gmail.com wrote: >
Hi all,
The method for adding derived fields has somewhat changed in the unitrefactor of 3.0, and we have the opportunity to make it a bit easier to add new fields -- especially after a parameter file has been created, which previously has been a pain. Below is a brief summary.
The current way we do this is with:
add_field(...)
or
@derived_field def some_function(...
The field system is now plugin based, which means we load plugins for different things and fields are dynamically added. One big advantage is that logic for things like strides and whatnot doesn't need to happen inside the field functions, but it also provides some compartmentalization of things.
I haven't implemented @derived_field and add_field yet in this system, but my plan is to do so by creating a "custom" plugin, to which these will add field definitions, which will always get loaded. But if you do:
pf = ... pf.h.whatever...
@derived_field def func(...)...
currently, and in the proposed implementation, this will not let them be detected. But I want to make it so that we can do this:
pf.add_field( ... ) and @pf.derived_field, which will both dynamically add fields to existing parameter files. What this means:
I'm going to be implementing the uncontroversial part of this, which is the dynamic field adding to a "custom" plugin, and unless I hear otherwise I'll continue on this track with the dynamic pf field addition.
-Matt
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org