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

general.version can not be a float? #170

Open
JanStreffing opened this issue Jul 30, 2021 · 3 comments
Open

general.version can not be a float? #170

JanStreffing opened this issue Jul 30, 2021 · 3 comments

Comments

@JanStreffing
Copy link
Contributor

In https://github.com/esm-tools/esm_tools/tree/awicm-3-frontiers-frozen I'm preparing for the upcoming freeze of AWICM 3.0.
I renamed a bunch of esm_tools awicm3 versions that had names that were all over the place. The new tagged version is supposed to be called 3.0:

        available_versions:
        - '3.0'
        - 'master'
        - 'frontiers'
        - 'frontiers-xios'
        - 'deck'

When running esm_master after making the changes I get:

Traceback (most recent call last):
  File "/home/ollie/jstreffi/.local/bin/esm_master", line 8, in <module>
    sys.exit(main())
  File "/home/ollie/jstreffi/.local/lib/python3.7/site-packages/esm_master/cli.py", line 103, in main
    main_flow(parsed_args, target)
  File "/home/ollie/jstreffi/.local/lib/python3.7/site-packages/esm_master/esm_master.py", line 29, in main_flow
    setups2models = setup_and_model_infos(vcs, main_infos, parsed_args)
  File "/home/ollie/jstreffi/.local/lib/python3.7/site-packages/esm_master/compile_info.py", line 372, in __init__
    self.all_packages = self.list_all_packages(vcs, general)
  File "/home/ollie/jstreffi/.local/lib/python3.7/site-packages/esm_master/compile_info.py", line 509, in list_all_packages
    no_infos=True,
  File "/home/ollie/jstreffi/.local/lib/python3.7/site-packages/esm_master/software_package.py", line 33, in __init__
    None, self.kind, self.model, self.version
  File "/home/ollie/jstreffi/.local/lib/python3.7/site-packages/esm_master/compile_info.py", line 597, in assemble_raw_name
    raw = raw + sep + version
TypeError: can only concatenate str (not "float") to str

The error seems similar in nature to #71 A case of python thinking it's smart and converting a string that looks like a float into a float. Unless of course I'm mistaken and the actually error is somewhere else entirely. Which is possible given that I just changed the names and versions of dozens of things as once.

+---------------------+-----------+---------------------------------------------------------+--------------------------+----------------------+
| package_name        | version   | file                                                    | branch                   | tags                 |
|---------------------+-----------+---------------------------------------------------------+--------------------------+----------------------|
| esm_calendar        | 5.0.0     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_database        | 5.0.0     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_environment     | 5.1.1     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_master          | 5.1.3     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_motd            | 5.0.2     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_parser          | 5.1.7     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_plugin_manager  | 5.0.1     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_profile         | 5.0.0     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_rcfile          | 5.1.0     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_runscripts      | 5.1.27    | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
| esm_tools           | 5.0.12    | /home/ollie/jstreffi/esm_tools                          | awicm-3-frontiers-frozen | v5.0.12-351-g48a7d2c |
| esm_version_checker | 5.1.4     | /home/ollie/jstreffi/.local/lib/python3.7/site-packages |                          |                      |
+---------------------+-----------+---------------------------------------------------------+--------------------------+----------------------+
@mandresm
Copy link
Contributor

mandresm commented Jul 30, 2021

The problem is likely here:

https://github.com/esm-tools/esm_tools/blob/48a7d2cc3026e7edf37c784cba931b5245699869/configs/setups/awicm3/awicm3.yaml#L26

For a provisional fast solution make it be '3.0':.

@JanStreffing
Copy link
Contributor Author

JanStreffing commented Jul 30, 2021

I renamed it to v3.0 and it got rid of the error. So indeed this seems to be the problem. I don't think i'll go for '3.0' since users have to place the version into their runscript and this invites user error. For now i stick with v3.0

@denizural
Copy link
Contributor

I found the same issue last week and wrote it in my TODO list and will have a look after I finish the fesom-recom stuff.

It probably becomes a float after the parser thinks that it looks like a float. As Miguel says, a quick solution is make quotes around or place a character in front.

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

3 participants