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

get_projection_params and find_location has to become a standalone #2349

Closed
ReimarBauer opened this issue May 11, 2024 · 2 comments · Fixed by #2580
Closed

get_projection_params and find_location has to become a standalone #2349

ReimarBauer opened this issue May 11, 2024 · 2 comments · Fixed by #2580
Milestone

Comments

@ReimarBauer
Copy link
Member

In wms we don't need the config_loader but create a dependency to that by importing

 File "/__w/MSS/MSS/docs/../mslib/mswms/mpl_hsec.py", line 45, in <module>
    from mslib.utils.coordinate import get_projection_params

When we extract the function from coordinate the module needs not to be loaded and doesn't import the config_loader

Traceback (most recent call last):
  File "/__w/MSS/MSS/docs/conf.py", line 81, in <module>
    import mslib.mswms.wms
  File "/__w/MSS/MSS/docs/../mslib/mswms/wms.py", line 67, in <module>
    from mslib.mswms.gallery_builder import add_image, write_html, add_levels, add_times, \
  File "/__w/MSS/MSS/docs/../mslib/mswms/gallery_builder.py", line 40, in <module>
    import mswms_settings
  File "/github/home/mss/mswms_settings.py", line 50, in <module>
    from mslib.mswms import mpl_hsec_styles
  File "/__w/MSS/MSS/docs/../mslib/mswms/mpl_hsec_styles.py", line 76, in <module>
    from mslib.mswms.mpl_hsec import MPLBasemapHorizontalSectionStyle
  File "/__w/MSS/MSS/docs/../mslib/mswms/mpl_hsec.py", line 45, in <module>
    from mslib.utils.coordinate import get_projection_params
  File "/__w/MSS/MSS/docs/../mslib/utils/coordinate.py", line 36, in <module>
    from mslib.utils.config import config_loader
  File "/__w/MSS/MSS/docs/../mslib/utils/config.py", line 40, in <module>
    from mslib.msui import constants
  File "/__w/MSS/MSS/docs/../mslib/msui/constants.py", line 38, in <module>
    ROOT_FS = open_fs(MSUI_CONFIG_PATH)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mssenv/lib/python3.11/site-packages/fs/opener/registry.py", line 220, in open_fs
    _fs, _path = self.open(
                 ^^^^^^^^^^
  File "/opt/conda/envs/mssenv/lib/python3.11/site-packages/fs/opener/registry.py", line 177, in open
    open_fs = opener.open_fs(fs_url, parse_result, writeable, create, cwd)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mssenv/lib/python3.11/site-packages/fs/opener/osfs.py", line 40, in open_fs
    osfs = OSFS(path, create=create)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/mssenv/lib/python3.11/site-packages/fs/osfs.py", line 141, in __init__
    raise errors.CreateFailed(message)
fs.errors.CreateFailed: root path '/github/home/.config/msui' does not exist
ERROR conda.cli.main_run:execute(124): `conda run python conf.py` failed. (See above for error)
Error: Process completed with exit code 1.
@ReimarBauer ReimarBauer added this to the 10.0.0 milestone May 11, 2024
@ReimarBauer
Copy link
Member Author

ReimarBauer commented Dec 2, 2024

config_loader is used in find_location, so we need to extract this

moving first get_projection_params, then checkung if we need to move find_location too.

@ReimarBauer ReimarBauer changed the title get_projection_params has to become a standalone find_location has to become a standalone Dec 2, 2024
@ReimarBauer ReimarBauer changed the title find_location has to become a standalone get_projection_params has to become a standalone Dec 2, 2024
@ReimarBauer
Copy link
Member Author

mss_plot_driver currently also imports

import mslib.utils.coordinate as coordinate

so find_location must be moved too

@ReimarBauer ReimarBauer changed the title get_projection_params has to become a standalone get_projection_params and find_location has to become a standalone Dec 2, 2024
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

Successfully merging a pull request may close this issue.

1 participant