Skip to content

Comments

Add updated installation instructions#138

Merged
dalonsoa merged 16 commits intodevelopfrom
new_installation
Aug 2, 2023
Merged

Add updated installation instructions#138
dalonsoa merged 16 commits intodevelopfrom
new_installation

Conversation

@dalonsoa
Copy link
Collaborator

@dalonsoa dalonsoa commented Jul 20, 2023

Description

Adds thorough and up-to-date installation instructions to the documentation available in Read the Docs. It also removes most of the information in the README (that needs updating one the documentation is live) so there is only one set of instructions, to avoid conflict.

Focus the review in installation.rst. Modifying the other files are just side effects. You can find the rendered version of these instructions in https://muse-os.readthedocs.io/en/new_installation/installation.html

Fixes #133
Fixes #109
Fixes #132

Type of change

Please add a line in the relevant section of
CHANGELOG.md to
document the change (include PR #) - note reverse order of PR #s.

  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass: $ python -m pytest
  • The documentation builds and looks OK: $ python -m sphinx -b html docs docs/build

Further checks

N/A

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Copy link
Collaborator

@sgiarols sgiarols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here my comments.
I worked n a Windows machine and could test the procedure with pyenv and pipx on Windows.
venv did not work.

In general, I wonder whether venv is really useful as a developer may be familiar already with Anaconda and prefer to use Anaconda platform


The main page for the documentation can then be found at ``docs/build/html/index.html`` and the file can viewed from any web browser.

Configuring VSCode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mention editors alternative to VSCode can be used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. If you are using a different editor, maybe you can write some instructions. The more instructions, the better!


### Recommended way
MUSE is available in `PyPI` and therefore it can be installed easily with `pip`. Detailed instructions on how to do that ensuring the right version of Python is used can be found in the Documentation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to have the instructions only on one side to avoid repetitions. We would need a direct link to the documentation from the README file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the text of the PR it is indicated that the README needs updating once this is merge. I cannot update the README until that happens.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, OK, so I misunderstood and the README would still have back again the info on the installation once the doc is updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think I was not clear either. The README will be short, as I have left it, but the link to the documentation in RdDs cannot be added until this is merged because there's nothing to point to (I can point to the documentation overall, but not to the specific sections of it because those have changed). Is it clearer?


Creating a virtual environment with ``venv``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit unsure that having venv would be useful. Compared to conda approach, it does not allow to know the decide the python version, compared to pyenv we still need to build an environment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a professional developer, I refuse to use conda and prefer, by a long shot, venv, so I will keep it for sure. It is way faster, despite not letting you choose the python version. conda tries to do everything and the result is pretty poor.

In the developing phase, MUSE can also be used to run test cases to check that the model would reproduce expected results from a defined set of input data. Tests can be run with the command [pytest](https://docs.pytest.org/en/latest/), from the testing framework of the same name.

Within the ``MUSE-OS`` directory, just run:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should say what needs to be checked to understand whether a user is in the MUSE-OS directory. Maybe we could have a screenshot showing the path on the command line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but please let's keep in mind that we are talking about people aiming to develop MUSE. By necessity, they need to have some level of competency and know what they are doing.

----------------------------

Developers of MUSE will need to have the version control tool ``git`` installed in their system and be familiar with its usage. The `Introduction to Git and GitHub for software development <https://imperialcollegelondon.github.io/introductory_grad_school_git_course/>`_ course created by `Imperial RSE Team <https://www.imperial.ac.uk/admin-services/ict/self-service/research-support/rcs/service-offering/research-software-engineering/>`_ can be a good place to start.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need the few instructions here to install git

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, if anyone wants to develop MUSE, they will need to have a bit of initiative and follow up on the resources provided. There's no point of giving everything this low level having so many excellent resources and guides out there, specially to someone who intends to become a developer. A certain level of competency on that front is to be required. But that's just my opinion.


### Recommended way
MUSE is available in `PyPI` and therefore it can be installed easily with `pip`. Detailed instructions on how to do that ensuring the right version of Python is used can be found in the Documentation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the text of the PR it is indicated that the README needs updating once this is merge. I cannot update the README until that happens.

----------------------------

Developers of MUSE will need to have the version control tool ``git`` installed in their system and be familiar with its usage. The `Introduction to Git and GitHub for software development <https://imperialcollegelondon.github.io/introductory_grad_school_git_course/>`_ course created by `Imperial RSE Team <https://www.imperial.ac.uk/admin-services/ict/self-service/research-support/rcs/service-offering/research-software-engineering/>`_ can be a good place to start.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, if anyone wants to develop MUSE, they will need to have a bit of initiative and follow up on the resources provided. There's no point of giving everything this low level having so many excellent resources and guides out there, specially to someone who intends to become a developer. A certain level of competency on that front is to be required. But that's just my opinion.

In the developing phase, MUSE can also be used to run test cases to check that the model would reproduce expected results from a defined set of input data. Tests can be run with the command [pytest](https://docs.pytest.org/en/latest/), from the testing framework of the same name.

Within the ``MUSE-OS`` directory, just run:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but please let's keep in mind that we are talking about people aiming to develop MUSE. By necessity, they need to have some level of competency and know what they are doing.


The main page for the documentation can then be found at ``docs/build/html/index.html`` and the file can viewed from any web browser.

Configuring VSCode
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. If you are using a different editor, maybe you can write some instructions. The more instructions, the better!

@dalonsoa
Copy link
Collaborator Author

I think I've address or answered all of your comments, @sgiarols , but please let me know if there's anything that does not look right.

@sgiarols
Copy link
Collaborator

I think I've address or answered all of your comments, @sgiarols , but please let me know if there's anything that does not look right.

Thanks. I think it all looks good. I only have two questions left.

  • do you think it is worth adding virtualenv
  • do we need the alias instructions

@dalonsoa
Copy link
Collaborator Author

For what I can tell, venv and virtualenv` are really similar, so I'm not sure it is worth adding it to the mix. See comments in Stackoverflow.

About the alias, many people will not need it - obviously not those that do not use Windows. But if you have that problem that whenever you try to run Python, you get the Microsoft Store, it will be difficult to figure out what is going on and how to fix it without some direction. I would leave it, just in case.

I've follow these instructions in a MacOS and two pristine Windows computer. In one, I had the problem with the alias, but in the other I didn't, so...

@ahawkes
Copy link
Collaborator

ahawkes commented Jul 21, 2023 via email

@sgiarols
Copy link
Collaborator

sgiarols commented Jul 21, 2023

Indeed, it is confusing an unnerving for a new user to see a warning in a very basic example, and the explanation that wind is somehow outside the system boundaries is also confusing and reduces confidence in the model. What exactly is going on here? A

MUSE is saying that no process is producing wind in the current case study. We can simply address this problem in the case definition.

-- 2023-07-20 13:45:25 - muse.mca - INFO
Finish simulation year 2050!


Copy link
Collaborator

@sgiarols sgiarols Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-- 2023-08-02 09:11:50 - muse.sectors.sector - INFO
Running gas for year 2050

-- 2023-08-02 09:11:50 - muse.interactions - INFO
Net new_to_retro of 1 interactions interacting via transfer

-- 2023-08-02 09:11:50 - muse.hooks - INFO
Computing initial_asset_transform: default

-- 2023-08-02 09:11:50 - muse.hooks - INFO
Computing initial_asset_transform: clean

-- 2023-08-02 09:11:50 - muse.demand_share - INFO
Computing demand_share: default

-- 2023-08-02 09:11:51 - muse.production - INFO
Computing production: max

-- 2023-08-02 09:11:51 - muse.production - INFO
Computing production: max

-- 2023-08-02 09:11:51 - muse.production - INFO
Computing production: share

-- 2023-08-02 09:11:51 - muse.mca - INFO
Finish simulation year 2050!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dalonsoa , I updated screenshot of model results. This can substitute your lines.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator

@sgiarols sgiarols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remembering we needed to update the model output before merging this PR

@dalonsoa dalonsoa merged commit b32e6a7 into develop Aug 2, 2023
@dalonsoa dalonsoa deleted the new_installation branch August 2, 2023 09:29
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 this pull request may close these issues.

Pandoc needs to be explicitly installed to build the documentation Be explicit on pipx instructions Update installation instructions for windows

3 participants