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

cpymad in win7 #13

Closed
Landau1908 opened this issue Apr 7, 2015 · 3 comments
Closed

cpymad in win7 #13

Landau1908 opened this issue Apr 7, 2015 · 3 comments

Comments

@Landau1908
Copy link

Hey, Thomas

I'm now back into win7 and get rid of scientific linux because it cracked again.

I have succeeded installing cpymad on my thinkpad with 64bits win7. The process is very successful and no problem has been happened.

First, I install pythonxy 2.7.9, the newest version currently.

Second, I install cpymad via pip according to your instructions.

install

But I have some troubles when running the Usage.

First, I can't modify the assignment to command_log. I want to store command history to my desired place.

error1

Second, I can't find any MadX file in my disk. I remeber, that there exist amount of MadX examples in linux. What happened to this?

Third, could you give me a complete example to begin cpymad?

@coldfix
Copy link
Member

coldfix commented Apr 7, 2015

I'm now back into win7 and get rid of scientific linux because it cracked again.

I didn't try scientific linux so far, but I had no problems on other distributions (ubuntu, mint, debian, arch). I think, I'd recommend mint for beginners.

I have succeeded installing cpymad on my thinkpad with 64bits win7. The process is very successful and no problem has been happened.

Great.

First, I can't modify the assignment to command_log. I want to store command history to my desired place.
`madx=Madx(command_log='E:\cython_madx\test\log.madx')

The backslash \ is an escape character inside strings, e.g. '\t' stands for <Tab> and '\\' stands for a literal backslash. The error message ([...] or filename: 'E:\\cython_madx\test\\log.madx', you can see that only the first and last backslash got recognized as path separators. If you don't want to use double '\\' inside your strings, prefix the first quote by an 'r'. E.g.:

madx = Madx(command_log=r'E:\cython_madx\test\log.madx')

Second, I can't find any MadX file in my disk. I remeber, that there exist amount of MadX examples in linux. What happened to this?

Are you talking about the models which were previously distributed inside cpymad or about log files? As for the models: I cut them out, their license is difficult, I don't want to maintain them, I'm not affiliated with CERN ;). And, as they are data files, they do not belong in a code repository.

Third, could you give me a complete example to begin cpymad?

You can ask me any specific question. The example in the README is examplatory for most of what cpymad can be used for.

Did you read python tutorials and MAD-X manual so far? Without knowledge about MAD-X and python, cpymad will not be useful. cpymad is a python-binding of MAD-X, i.e. it makes the MAD-X library accessible from python. If you don't plan to program in python or make use of data-analysis via scipy/numpy/matplotlib, it doesn't really make sense to use cpymad instead of plain MAD-X.

@Landau1908
Copy link
Author

Are you talking about the models which were previously distributed inside cpymad or about log files? As for the models: I cut them out, their license is difficult, I don't want to maintain them, I'm not affiliated >with CERN ;). And, as they are data files, they do not belong in a code repository.

I mean, .madx file can't be found in my disk anyway. For linux, many examples such as .madx file can be found in some folder. I think this is due to installing libmadx in linux but not for windows, right?

Did you read python tutorials and MAD-X manual so far? Without knowledge about MAD-X and python, cpymad will not be useful. cpymad is a python-binding of MAD-X, i.e. it makes the MAD-X library accessible from python. If you don't plan to program in python or make use of data-analysis via >scipy/numpy/matplotlib, it doesn't really make sense to use cpymad instead of plain MAD-X.

Yes, I have read python tutorials and programmed few pieces of codes via function_based program and object- oriented program is the next plan.
I am reading MAD-X manual and have even not used it.
My goal is to call madx via python and Visualise scientific data.

Currently, I want to make a match for optimizing beam spot at a fixed position by adjusting only few magnets.

@coldfix
Copy link
Member

coldfix commented May 22, 2015

Hey, I hope you are fine with the solution I gave you and hence closing this for now as I don't see an open question. Reopen if needed.

@coldfix coldfix closed this as completed May 22, 2015
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

No branches or pull requests

2 participants