pedvide / simetuc

Simulating Energy Transfer and Upconversion
MIT License
4 stars 1 forks source link

Can't find the config_file.txt #2

Open wodebc opened 6 years ago

wodebc commented 6 years ago

Hello Pedro, I came across your simetuc code and would like to try it for my own research. However, after I installed all the packages, when I execute the command: "simetuc config_file.txt -v -1".

An error popped up: usage: simetuc-script.py [-h] [--version] [-v | -q] [--no-plot] [--average] [-l | -d | -s | -p | -c [d] | -o] [--no-save | --save-txt] configFilename simetuc-script.py: error: unrecognized arguments: -1

It seems that there is no such a file named "config_file.txt". Could you tell me how to figure it out? Thanks very much. issue

pedvide commented 6 years ago

Hello,

When you execute simetuc config_file.txt <options>, you're asking simetuc to read a file with the configuration of your problem. This file has to be present in the same folder from where you're executing simetuc (in your case C:\Users\UCN-912, but I recommend that you create a subfolder and work inside it).

The manual describes the configuration file in detail. I also provide several examples, for example: https://github.com/pedvide/simetuc/blob/master/simetuc/config_file.cfg. You'll have to download this file and place it in your work folder, and of course, adapt the file to your problem.

Another problem that you had is that initially you executed simetuc config_file.txt -v -1, but -1 is not an option. Most likely you wanted to generate the lattice, the command for that is -l (a lowercase L letter, not the number one).

I hope this helps, let me know if you have more issues.

wodebc commented 6 years ago

Hi Pedro, Thanks so much for your quick reply. I first downloaded the "cofig_file.cfg" from the link you gave, and copied it to a new folder, where I executed the command, "simetuc config_file.txt‘’.But I got an error and it said there was no 'config_file.txt' file). Then, I simply changed the name of 'config_file.cfg' to 'config_file.txt', but still got the following error: (base) C:\Users\UCN-912\test>simetuc config_file.txt -v -l 20:29:01 - simetuc : INFO Starting program... 20:29:01 - simetuc : INFO Loading configuration... 20:29:01 - simetuc.settings : INFO Reading settings file (config_file.txt)... 20:29:02 - simetuc.settings : ERROR Error while parsing the config file: config_file.txt! Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 830, in _load_yaml_file file_dict = self._ordered_load(file, yaml.SafeLoader) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 884, in _ordered_load return yaml.load(stream, OrderedLoader) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml__init.py", line 72, in load return loader.get_single_data() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\constructor.py", line 35, in get_single_data node = self.get_single_node() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\composer.py", line 36, in get_single_node document = self.compose_document() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\composer.py", line 58, in compose_document self.get_event() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\parser.py", line 118, in get_event self.current_event = self.state() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\parser.py", line 193, in parse_document_end token = self.peek_token() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\scanner.py", line 128, in peek_token self.fetch_more_tokens() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\scanner.py", line 220, in fetch_more_tokens return self.fetch_value() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\scanner.py", line 576, in fetch_value self.get_mark()) yaml.scanner.ScannerError: mapping values are not allowed here in "config_file.txt", line 563, column 24 20:29:02 - simetuc.settings : ERROR in "config_file.txt", line 563, column 24 20:29:02 - simetuc.settings : ERROR mapping values are not allowed here 20:29:02 - simetuc.settings : ERROR Please correct data and retry. Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 830, in _load_yaml_file file_dict = self._ordered_load(file, yaml.SafeLoader) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 884, in _ordered_load return yaml.load(stream, OrderedLoader) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\init__.py", line 72, in load return loader.get_single_data() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\constructor.py", line 35, in get_single_data node = self.get_single_node() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\composer.py", line 36, in get_single_node document = self.compose_document() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\composer.py", line 58, in compose_document self.get_event() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\parser.py", line 118, in get_event self.current_event = self.state() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\parser.py", line 193, in parse_document_end token = self.peek_token() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\scanner.py", line 128, in peek_token self.fetch_more_tokens() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\scanner.py", line 220, in fetch_more_tokens return self.fetch_value() File "C:\Users\UCN-912\Anaconda3\lib\site-packages\yaml\scanner.py", line 576, in fetch_value self.get_mark()) yaml.scanner.ScannerError: mapping values are not allowed here in "config_file.txt", line 563, column 24

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\Scripts\simetuc-script.py", line 5, in sys.exit(simetuc.commandline.main()) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\commandline.py", line 161, in main cte = settings.load(args.filename) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 1131, in load settings.load(filename) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 705, in load config_cte = loader.load_settings_file(filename) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 807, in load_settings_file self.file_dict = self._load_yaml_file(filename, direct_file) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 850, in _load_yaml_file 'the config file ({})!'.format(filename)) from exc simetuc.settings.ConfigError: Something went wrong while parsing the config file (config_file.txt)!

Could you take a look at the issue? Thanks again,

Best,

Shawn

pedvide commented 6 years ago

Hello Shawn,

It seems the link I posted doesn't actually link to the right file. It seems the file is empty actually! I think this link should work https://raw.githubusercontent.com/pedvide/simetuc/master/simetuc/config_file.cfg

Could you try with that one?

wodebc commented 6 years ago

Hi Pedro,

I have tried the configure file you just gave. The extension of the confi_file was changed to txt before running the command. But unfortunately, the error still existed:

(base) C:\Users\UCN-912>cd test (base) C:\Users\UCN-912\test>simetuc config_file.txt -v -l 21:47:46 - simetuc : INFO Starting program... 21:47:46 - simetuc : INFO Loading configuration... 21:47:46 - simetuc.settings : INFO Reading settings file (config_file.txt)... 21:47:46 - simetuc.settings : WARNING These sections should not be present in the file: 21:47:46 - simetuc.settings : WARNING {'energy_transfer'} C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py:954: ConfigWarning: Some values or sections should not be present in the file. warnings.warn('Some values or sections should not be present in the file.', ConfigWarning) 21:47:46 - simetuc.settings : ERROR Incorrect branching ratio: EM_55 Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 982, in _get_state_index index = list_labels.index(state_label) ValueError: 'EM_55' is not in list 21:47:46 - simetuc.settings : ERROR 'EM_55' is not a valid state label 21:47:46 - simetuc.settings : ERROR Wrong labels in optimization: processes! 'EM_55' is not a valid state label Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 982, in _get_state_index index = list_labels.index(state_label) ValueError: 'EM_55' is not in list

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 577, in _parse_optim_params for process in set_other_params] File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 577, in for process in set_other_params] File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 1016, in _get_branching_ratio_indices process=process) for s in states_list) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 1016, in process=process) for s in states_list) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 988, in _get_state_index raise LabelError(msg) from err simetuc.settings.LabelError: 'EM_55' is not a valid state label

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\UCN-912\Anaconda3\Scripts\simetuc-script.py", line 5, in sys.exit(simetuc.commandline.main()) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\commandline.py", line 161, in main cte = settings.load(args.filename) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 1131, in load settings.load(filename) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 764, in load self.states, self.excitations) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 530, in _parse_optimization dict_ET, dict_decay, dict_states) File "C:\Users\UCN-912\Anaconda3\lib\site-packages\simetuc\settings.py", line 588, in _parse_optim_params raise LabelError(msg) from err simetuc.settings.LabelError: Wrong labels in optimization: processes! 'EM_55' is not a valid state label

pedvide commented 6 years ago

Hi Shawn,

That's odd, what version do you have installed. Execute simetuc --version

The latest is 1.8.2. If yours is lower, execute pip install -U simetuc

wodebc commented 6 years ago

Hi Pedro,

You are right. The version I had before was 1.3.X. So I have updated the version using pip install command. However, after the update, when I check the new version, anther error popped up:

(base) C:\Users\UCN-912>simetuc --version Traceback (most recent call last): File "c:\users\ucn-912\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\ucn-912\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\UCN-912\Anaconda3\Scripts\simetuc.exe__main__.py", line 5, in File "c:\users\ucn-912\anaconda3\lib\site-packages\simetuc\commandline.py", line 70 ''' ^ SyntaxError: invalid syntax

Looks like I need to correct the syntaxerror in the py file?

Best,

Shawn

pedvide commented 6 years ago

What version of Python do you have installed? (python --version) I know this works with 3.6. Either you have a lower version or there's something else wrong with your python installation. Please check that you have 3.6 and if not, update using conda install python=3.6 and then conda update --all.

wodebc commented 6 years ago

Hi Pedro, Thanks so much for your help! I am using python 3.6. I guess something did go wrong with my installation. I am uninstalling all the packages and will reinstall them again. I will let you know how the things go. Thanks again, Best, Shawn

pedvide commented 6 years ago

Hi,

I'm sorry you have to do all this! Usually the installation is quite easy, I don't know why it wouldn't work for you. Sometimes Windows is tricky and indeed reinstalling seems to be a good idea. I hope it works afterwards.

Please let me know if you have more issues.