---
# System prepended metadata

title: MPHY0021 - Day 7 (25th November 2021)
tags: [class, teaching, mphy0021]

---

# MPHY0021 - Day 7 (25th November 2021)

:::info
## :tada: Welcome to the seventh day! 📦🐍💄
 

### Today
Today we will look at 
- How to choose libraries (and install them)
- How to create command line interfaces for your scripts
- How to create a package :package: 
:::

### :stopwatch: Time keeper
- [name=Zhengxiang Wei] :raised_hand: 5' before the end.
 - 10:00 - 10:50
 - 11:05 - 11:55
 - 12:05 - 12:55

### Review from last week 

- :books: Documentation
- :mag::hourglass_flowing_sand: finding problems in history
- :mag::bug: finding bugs with a debugger

:::warning
### Groups created! 

- go to [this group forum in moodle](https://moodle.ucl.ac.uk/mod/forum/view.php?id=3246047) and note your working group
  ![](https://i.imgur.com/81KqmqS.png)  
- Change your name to `SG<group number> - <Your name>`, so from the image - rename yourself to `SG13 - My name`
- React with :heavy_check_mark: so we know you're renamed yourself
- Any issues? react with :x: 
:::



#### What was discussed during the week :newspaper: 
- 1st Assignment done! Remember to [tell us how long it took](https://moodle.ucl.ac.uk/mod/choice/view.php?id=942597).
- Group assignment: you are in fixed groups now, all the activities from today (including the asynchronous discussions) will be with your team members.
- [type hints discussion](https://moodle.ucl.ac.uk/mod/forum/discuss.php?d=671450)
  :::spoiler what are type hints?
  
  Check [python docs about type hints](https://docs.python.org/3/library/typing.html) and [RealPython's Type checking guide](https://realpython.com/python-type-checking/).
  
  ```python
  def greeting(name: str) -> str:
      return 'Hello ' + name
  ```
  :::
- You've told us about [your favourite :package: managers](https://moodle.ucl.ac.uk/mod/forum/view.php?id=2552785)!
        - Did you know what's also known as the [:cheese_wedge: shop](https://en.wikipedia.org/wiki/Cheese_Shop_sketch)? ([video](https://youtu.be/Hz1JWzyvv8A), [script](https://montycasinos.com/montypython/scripts/cheese.php.html))
- Strike action next week

#### Discussion forum - favorite package manager
 
### Groups :handshake: 

We will be using the breaking rooms functionality of Zoom.
We have the following groups, and each group have its own document. Each week you will be in your working groups.

Once in your breakout-room, decide who will take notes ✍ and who will be sharing their screen :desktop_computer:.

:::danger
Remember your working group number in case you are disconnected and need to ask our DJ to be moved to your team.
:::

:::warning
🤝 Don't forget to also introduce yourself to your team
:question: Icebreaker: What's your favourite means of transportation?
:::

:::warning
:question: :package: 
From two libraries that seems to do the same and both have all the features you need, how do you choose which one to use?
:::

Discuss it within your teams and [select three characteristics to post **as a team** in the word cloud](https://www.menti.com/kokbw2dto1) (www.menti.com code: 5322 6450).
- Group 1: 
   - check input and output arguments
   - updated usually(in the latest version)
   - additional info from internet
- Group 2: 
   - Flexible arguments
   - Higher efficiency
   - Have more instructive documatations online
- Group 3:
    - documentations of the library
    - efficiency
    - easy to understand the functions and structures of the libraries
- Group 4: 
    - efficiency of the functions
    - size of the library (take the one with less options)
    - assess usability of the functions (looking at arguments)
    - check how other people use it - if more people use it then it most likely would be better 
    - level of documentations of the library
- Group 5: 
- Group 6: 
    - easy to use
    - efficiency 
    - easy to install
    - good documentation
    - compatibility with other packages
    - up-to-date features
- Group 7: 
    - larger community of users - more support
    - is it still active, maintained
    - documentation: installation and quick start guide
    - open source preferred
    - do they have automated testing & continuous integration
    - ideally clean code
- Group 8:
    - efficiency
    - popularity (or say stablity)
- Group 9:  - check whether the documentations are easy to understand.
            - check whether the community is active
- Group 10:
    - Documentation
    - Easy to install
    - Popularity
- Group 11: 
    - available documentation
    - community - larger the better
    - user knowledge of the library
    - user friendliness
    - flexibility of the library
    - installation process
- Group 12: - based on community
            - follow first the website on google
            - more stable, the website which is not updated very often
            - tutorials available
            - checking the reviews
            - see which one is more updated, recent last commit
- Group 13:
- Group 14: size of library, active dicussion online, recent last commit
- Group 15: 
            - Stability
            - online forum activity
            - date of last commit
            - copyright / use-restriction
            - quality of documentation
- Group 16: Efficiency and appropriateness of other features of the library
- Group 17: - Check reviews on community
            - Check whether the doucuments are easy to understand
            - Check which one have better compatibility
- Group 18:
    - For computing packages, speed should be considered
    - For others like plotting, emphasize documentation completeness and if it is popular
    - up-to-date and well-maintained
- Group 19: 
    - Simple/easy-to-read/not such abstract code
    - Availablity of documentation 
    - The one I have more experience with
    - How up to date the package is, has there been a recent update?
    - More/most popular one, widely used by other people
- Group 20: 
        - Hardware acceleration support #HPCgang
        - 
- Group 21:
    - Efficiency
    - Version (avalibility);
    - 
- Group 22:
- Group 23:
    - Better documentation
    - Mantained more recently
    - Large community of users
    - Additional resources on the internet (stack-overflow forums, tutorials)
    - Optimization of the functions
- Group 24:
- Group 25:
- Group 26:
    - Simple to use
    - Documentation
    - Dependencies
    - Hardware acceleration
- Group 27:
- Group 28:
- Group 29:


### Exercise: Creating a command line interface
:::info
In your own teams, work together to generate a command line interface following the steps in RSE-classwork issues: [:hash::three::two:](https://github.com/UCL-MPHY0021-21-22/RSE-Classwork/issues/32):heavy_minus_sign:[:hash::three::four:](https://github.com/UCL-MPHY0021-21-22/RSE-Classwork/issues/34)

```bash
python average_squares.py 1 2 3 --weights 0.1 0.4 0.5

```


:::spoiler call a helper to your room
If you need help, you can ask for us to drop in click "Ask for Help" :grey_question: button in the meeting controls.
If you don't find it, [watch this video showing where it is](https://www.youtube.com/watch?v=yIOMPRLQIHA).
:::


### Exercise: Creating a package
:::info
In your teams, help Charlene to make her script into a library.
Follow the instructions in RSE-classwork  issues: [:hash::three::six:](https://github.com/UCL-MPHY0021-21-22/RSE-Classwork/issues/36):heavy_minus_sign:[:hash::four::zero:](https://github.com/UCL-MPHY0021-21-22/RSE-Classwork/issues/40)

:::spoiler call a helper to your room
If you need help, you can ask for us to drop in click "Ask for Help" :grey_question: button in the meeting controls.
If you don't find it, [watch this video showing where it is](https://www.youtube.com/watch?v=yIOMPRLQIHA).
:::

##### Links
- [packaging notes](https://nbviewer.jupyter.org/github/UCL/rsd-engineeringcourse/blob/master/ch04packaging/03Packaging.ipynb)
- [Sphinx and documentation](https://nbviewer.jupyter.org/github/UCL/rsd-engineeringcourse/blob/master/ch04packaging/04documentation.ipynb)
- [Coding conventions](https://github.com/UCL/rsd-engineeringcourse/blob/master/ch05construction/02conventions.ipynb)

### Next week

- Project management


# Questions

:::info
Feel free to add any question below. Remember the syntax:
```
- Example question
  - [name=student_a] Example answer
  - [name=TA_1] Example answer
```
:::

- .Will this group in this week's online class be the group of next coursework?
  - [name=Alessandro] Yes, most likely (unless no-one else from your group shows up to the lesson, then you can temporarily join another group for today)
- .
  - [name=...]
- .
  - [name=...]



###### tags: `mphy0021` `teaching` `class`

