-
Notifications
You must be signed in to change notification settings - Fork 17
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
bugs related to boundarychk, electron energy vars, and scr fixed among others #4
Conversation
… here we have specific things from the ebysus code
…a similar format as in IDL, i.e., assign snapshot number while calling the variable and not when we define the object. We store the variables in the structure and cleans when we read new snapshot. Any other features.
… here we have specific things from the ebysus code
…ear and a minor bug when reading entropy
…ther, although I think it can be improved
I am unable to merge this as is. It is based on an older version of the repository and there are several conflicts. I will have to go through the changes manually and put in the new parts in the current master. |
helita/sim/bifrost.py
Outdated
'get composite variable %s. Note that' | ||
'simple_var available variables are: %s' % (var,repr(self.simple_vars)))) | ||
|
||
def do_mesh(self, x=None, y=None, z=None, nx=None, ny=None, nz=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not generic. It has values hardcoded. It does not belong here!
helita/sim/cstagger.pyx
Outdated
|
||
ctypedef fused FLOAT_t: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be removed. Now cstagger.pyx uses fused types.
helita/sim/cstagger.pyx
Outdated
------- | ||
None. Results saved in cstagger.zupc, cstagger.zdnc. | ||
''' | ||
def init_stagger(int mz, FLOAT_t dx, FLOAT_t dy, np.ndarray[FLOAT_t, ndim=1] z, np.ndarray[FLOAT_t, ndim=1] zdn, np.ndarray[FLOAT_t, ndim=1] dzup, np.ndarray[FLOAT_t, ndim=1] dzdn): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is replacing previously updated code with an old version.
On Sep 11, 2017, at 8:41 AM, Tiago M. D. Pereira ***@***.***> wrote:
@tiagopereira commented on this pull request.
In helita/sim/bifrost.py <#4 (comment)>:
> else:
raise ValueError(('_get_composite_var: do not know (yet) how to'
- 'get composite variable %s.' % var))
+ 'get composite variable %s. Note that'
+ 'simple_var available variables are: %s' % (var,repr(self.simple_vars))))
+
+ def do_mesh(self, x=None, y=None, z=None, nx=None, ny=None, nz=None,
This function is not generic. It has values hardcoded. It does not belong here!
I asked where do you want to have the do_mesh (BTW, this do_mesh is 3 times shorter than
the idl version!). I want to add code that allows me to create snapshots, mesh and tables (also for ebysus
that I have already partially done).
In helita/sim/cstagger.pyx <#4 (comment)>:
>
-ctypedef fused FLOAT_t:
This should not be removed. Now cstagger.pyx uses fused types.
Ups, something I did wrong here. I though I had this as you had. I wonder if I deleted
some version that I had and I shouldn’t… Do you want me to go through this?
In helita/sim/cstagger.pyx <#4 (comment)>:
> - From init_stagger.c and init_stagger.pro
-
- Parameters
- ----------
- mz - integer
- Number of z points
- z - 1-D ndarray, float
- z scale
- zdn - 1-D ndarray, float
- z scale derivative
-
- Returns
- -------
- None. Results saved in cstagger.zupc, cstagger.zdnc.
- '''
+def init_stagger(int mz, FLOAT_t dx, FLOAT_t dy, np.ndarray[FLOAT_t, ndim=1] z, np.ndarray[FLOAT_t, ndim=1] zdn, np.ndarray[FLOAT_t, ndim=1] dzup, np.ndarray[FLOAT_t, ndim=1] dzdn):
Again, this is replacing previously updated code with an old version.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#4 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANp4BDbMbuuFBXQj2yv591lSEDQmuX2cks5shVSlgaJpZM4PNbnQ>.
I am not sure what is wrong there. Note that the version above is ready to do derivative and xdn and ydn etc.
J
|
helita/sim/bifrost.py
Outdated
@@ -329,44 +360,196 @@ def _get_simple_var_xy(self, var, order='F', mode='r'): | |||
return np.memmap(filename, dtype=self.dtype, order=order, offset=offset, | |||
mode=mode, shape=(self.nx, self.ny)) | |||
|
|||
|
|||
def _get_composite_var(self, var): | |||
def boundcut(self, name,var): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should only be called when params['boundarychk'] = 1
, but right now it is called all the time. Besides, it should not even exist. You are getting these problems because you called init_cstagger
with self.nz
, but you should have used self.nzb
, which includes the additional boundary points.
helita/sim/bifrost.py
Outdated
else: # will call xdn, ydn, or zdn to get r at cell faces | ||
return p / getattr(cstagger, var[1] + 'dn')(self.r) | ||
rdt = self.r.dtype | ||
cs.init_stagger(self.nz, self.dx, self.dy, self.z.astype(rdt), self.zdn.astype(rdt), self.dzidzup.astype(rdt), self.dzidzdn.astype(rdt)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always call init_cstagger
with self.nzb
instead of self.nz
to avoid boundary problems.
helita/sim/bifrost.py
Outdated
return result | ||
elif (len(var) > 2): | ||
if var in ['ixc', 'iyc', 'izc'] or var in ['exc', 'eyc', 'ezc']: | ||
p = self.variables[var[0:2] +'c'] = self.get_var(var[0:2],self.snap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There must be another way for this. Calling self.get_var
from inside self._get_composite_var
could result in an infinite loop. Please don't do it.
…F code as well as atomic info
…from diper to ebysus atom file format, and minor bugs fixed
Most of this was fixed by 51549f3, minus the conflicts. Closing. |
Does this mean that I should do the new fork now?
On Sep 26, 2017 4:03 AM, "Tiago M. D. Pereira" <notifications@github.com> wrote:
Closed #4 <#4>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ANp4BClqV_NvDj3AUxpn05nASpKY_YK-ks5smNnkgaJpZM4PNbnQ>
.
|
Yes. But be careful not to lose any files that are not updated in the master. |
I'm pretty sure I'll do stupid things.... :😁
…On Sep 26, 2017 8:51 AM, "Tiago M. D. Pereira" ***@***.***> wrote:
Yes. But be careful not to lose any files that are not updated in the
master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ANp4BFq66BG0FBlYfjDk9G63suHrzNdkks5smR1kgaJpZM4PNbnQ>
.
|
No description provided.