-
Notifications
You must be signed in to change notification settings - Fork 19
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
IO related code reorganization #103
Conversation
@NikoOinonen, please resolve the conflicts. I will then review the PR. |
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.
thanks a lot @NikoOinonen. The two main suggestions I have are:
- Please always use the same coding pattern:
from ppafm import io
io.loadXYZ(..)
- Please remove unnecessary comments.
dev/FARFF/test_FARFF_AuxMaps.py
Outdated
@@ -10,7 +10,6 @@ | |||
#from ppafm import fieldOCL as FFcl | |||
#from ppafm import RelaxOpenCL as oclr | |||
#from ppafm import common as PPU | |||
#from ppafm import basUtils | |||
#from ppafm.AFMulatorOCL_Simple import AFMulator | |||
#from ppafm.GeneratorOCL_Simple2 import InverseAFMtrainer | |||
#from ppafm.AuxMap import AuxMaps |
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.
Please remove the unnecessary comments and sys.path.append
. Same for all the occurrences below.
dev/bakup/GUImorse.py
Outdated
#io.saveVecFieldXsf( "DEBUG_FFcl", self.FF[:,:,:,:3].astype(np.float32), self.lvec ) | ||
#io.saveXSF( "DEBUG_FFcl_z.xsf", self.FF[:,:,:,2].astype(np.float32), self.lvec ) |
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.
#io.saveVecFieldXsf( "DEBUG_FFcl", self.FF[:,:,:,:3].astype(np.float32), self.lvec ) | |
#io.saveXSF( "DEBUG_FFcl_z.xsf", self.FF[:,:,:,2].astype(np.float32), self.lvec ) |
dev/bakup/conv_rho_mini.py
Outdated
#import GridUtils as GU | ||
#sys.path.append("/u/25/prokoph1/unix/git/ProbeParticleModel") | ||
|
||
from ppafm.io import loadXSF, saveXSF |
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.
I would suggest the following pattern everywhere:
from ppafm import io
io.saveXSF(..) # everywhere
dev/bakup/conv_rho_mini.py
Outdated
#saveXSF( "FF"+namestr+"_x.xsf", Fx*PQ, lvec1, head=head1 ) | ||
#saveXSF( "FF"+namestr+"_y.xsf", Fy*PQ, lvec1, head=head1 ) | ||
#saveXSF( "FF"+namestr+"_z.xsf", Fz*PQ, lvec1, head=head1 ) |
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.
eliminate.
#saveXSF( "FF"+namestr+"_x.xsf", Fx*PQ, lvec1, head=head1 ) | |
#saveXSF( "FF"+namestr+"_y.xsf", Fy*PQ, lvec1, head=head1 ) | |
#saveXSF( "FF"+namestr+"_z.xsf", Fz*PQ, lvec1, head=head1 ) |
dev/bakup/runOpenCLbatch.py
Outdated
@@ -159,7 +156,7 @@ def evalFF_LJC( iZPP, xyzs, Zs, qs, poss, typeParams, func_runFF=FFcl.runLJC ): | |||
FF = evalFFatoms_LJC( atoms, cLJs, poss, func_runFF=FFcl.runLJC ) | |||
FEin = FF[:,:,:,:4] + Q*FF[:,:,:,4:] | |||
Tff = time.clock()-t1ff; | |||
#GU.saveXSF( geomFileName+'_Fin_z.xsf', FEin[:,:,:,2], lvec ); | |||
# io.saveXSF( geomFileName+'_Fin_z.xsf', FEin[:,:,:,2], lvec ); |
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 are many commented lines everywhere in the files you updated. Just remove them, please.
@yakutovicha Most of the problems are in the scripts inside @ProkopHapala Could you check if these scripts are actually needed, and maybe delete or move them to some other branch if they are not important? So that we don't have to spent time modifying them when we do fixes like this. |
I am having a problem as this reorganization is heavily messing with my pull request, which is to be finished this week (if my son is not ill). Maybe I should wait to this one to be pushed and then I will change the NPY part of it? |
@ondrejkrejci We can also merge yours first and then pull those fixes here. Whichever way you think is easiest. |
If this is quicker than me, go ahead. |
My 2 cents on this topic. An open pull request will have more conflicts with time. That is normal because other people are also working on the code. Therefore, resolving merge conflicts is a natural part of collaborative development. An open pull request should never be a reason for others to wait or to stop working. |
Blocked till #119 is resolved. |
@NikoOinonen, please merge the |
Merged main and all checks are passing. |
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.
Thanks @NikoOinonen. LGTM.
I think it is a good step forward towards high-quality code 👍
Fixes #46
Reorganizing code related to file IO so that all IO functions are in one module called
io
:basUtils
toio
io
toatomicUtils
GridUtils
toio
. BasicallyGridUtils
now only functions as an interface to the C++ functions.