Skip to content

How to find self-created ncmat data files by a convenient way, but not by absolute paths? #82

Answered by tkittel
YangNi20 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @YangNi20,

Thank you for your question - "Cinema" sounds like an interesting project and I am happy to hear you are using NCrystal :-)

Fortunately, there are several ways you can make NCrystal find your files:

From Python:

import NCrystal as NC
NC.addCustomSearchDirectory("/path/to/your/files")

From C++:

#include "NCrystal/NCrystal.hh"
//...
NCrystal::DataSources::addCustomSearchDirectory("/path/to/your/files");

Or you can simply add your directory to the NCRYSTAL_DATA_PATH environment variable, for instance from a shell:

export NCRYSTAL_DATA_PATH="/path/to/your/files:$NCRYSTAL_DATA_PATH"

Finally, I should perhaps remind you that you can also register "files" in-memory rather than havi…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by YangNi20
Comment options

You must be logged in to vote
1 reply
@YangNi20
Comment options

Comment options

You must be logged in to vote
1 reply
@YangNi20
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants