Code Monkey home page Code Monkey logo

workshop's Introduction

Binder

Materials Project Workshop

Assets for the Materials Project workshop.

This repository is under development for our 2021 workshop. There may be changes up until the day(s) of the workshop. Click here for a snapshot of the 2020, 2019 and 2018 workshop assets.

Building the Documentation

The following command will build the workshop docs:

pip install -r requirements-docs.txt
python setup.py develop
mkdocs build

Developing

Develop new material in either jupyter-notebooks or Markdown documents in the workshop folder. Any data that needs to be preloaded for use in the notebooks should be kept in the python_module or kept locally in the lesson folder if it will be loaded as part of the lesson progress.

Please run pre-commit run -a before commiting new material to ensure it is properly formatted and cleaned of any problematic metadata such as kernel name in the Jupyter Notebook.

workshop's People

Contributors

acrutt avatar ardunn avatar dependabot[bot] avatar dwinston avatar espottesmith avatar guymoore13 avatar htz1992213 avatar jdagdelen avatar jmmshn avatar kdfong avatar mattmcdermott avatar mhsiron avatar mjwen avatar mkhorton avatar montoyjh avatar munrojm avatar oxana-a avatar rkingsbury avatar samblau avatar shreddd avatar shyamd avatar sivonxay avatar tschaume avatar utf avatar yang-ruoxi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workshop's Issues

2021 Materials Project API

Unclear Concepts

  • GET request directly to endpoint via browser, curl, etc...
  • Setting API_KEY as an environment variable.
  • Request specific data vs. requesting entire DB entry.

What Needs to be Added

  • Summary of differences with existing API including new endpoints.
  • Accessing MPRester through mp-api vs pymatgen.
  • Receiving populated pydantic models from the API and how to deal with them.
  • New ways to query that don't involve any MongoDB query operator syntax.
  • Equivalent supported_properties for each rester type.
  • Search vs. specific resters for different data.

2021 Basic Python Lesson Updates

Unclear Concepts:

  • The example on importing and using numpy and matplotlib introduces too much new content at once, and there isn’t sufficient time for the students to actually understand it. I would simplify this example.
  • The exercise “Copying (or Not)” on mutability was too rushed. I would suggest removing this example and spending more time on the for loop exercises.
  • There are some small references to topics covered in the next lesson or not covered at all, for example the pow() function, setting default arguments in functions, and if statements. I would try to minimize these where possible.

Missing:

  • How and why to add comments to your code
  • I would move the section on indentation from the Advanced Python lesson to this lesson, when for loops are introduced
  • The section on modifying lists could be expanded by adding discussion of the + operator, * operator, and list comprehension.

2021 Advanced Python Lesson Comments

Unclear/confusing

  • Various ways to do if statement and their application case, using ==, <, in, is None, etc.
  • Use before introduction
  • Syntax of the data structures, e.g. a function starts with keyword def...
  • How to loop over set, dict. e.g. the difference between lopping over dict and dict.items()

Missing/redundant

  • The discussion of set can be be fully removed; it's nice on its own but it's not connected to other parts and we don't use it that often throughout the workshop lessons
  • Add very brief discussion of class, no mentioning of inheritance and such. Class is so central to pymatgen and it is already used in the exercise
  • Discuss typing and documentation for function and class

mp_rester.query() is deprecated

The mp_rester.query() method is replaced with summary.search() method and thus all the notebooks gives error. Will there be some systematic fix to all the notebooks to be compatible with the new summary.search() method?

Thanks

Fireworks not rendering graph in workflow view

The following error is thrown when trying to view the workflow page in the fireworks webgui.

Looking into this now, just wanted to document it in case someone else knows the issue.

[2019-07-29 20:01:24,205] ERROR in app: Exception on /fireworks/wf/2/json [GET] Traceback (most recent call last): File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/fireworks/flask_site/app.py", line 77, in decorated return f(*args, **kwargs) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/fireworks/flask_site/app.py", line 229, in workflow_json return jsonify(nodes_and_edges) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/fireworks/flask_site/util.py", line 38, in jsonify dumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder) + '\n', File "/srv/conda/envs/notebook/lib/python3.7/site-packages/flask/json/__init__.py", line 211, in dumps rv = _json.dumps(obj, **kwargs) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/simplejson/__init__.py", line 399, in dumps **kw).encode(obj) TypeError: __init__() got an unexpected keyword argument 'encoding'

2021 Automated DFT Lesson Updates

Unclear Concepts

  • the material covered in the workshop video and written documentation is very different - should make these consistent
  • there's no introduction of the 4 VASP input files, specifically, what is a POSCAR?
  • explaining the POTCAR warning is a bit much to follow verbally, would benefit from a written explanation
  • workshop illustrates/demos concepts in VASP and asks participants to do exercises in QCHEM - the result is just practicing importing and this seems like a leap that may not benefit learning
  • how do workflows connect to capabilities in pymatgen

What's Missing

  • see how pymatgen can write input files (not just python objects)
  • how to parse DFT code outputs
  • seeing how the launchpad helps you manage multiple workflows and how the state of fireworks change
  • links to github documentation to explore pymatgen.io and atomate workflows
  • how can you modify and input files?
  • where can I find non-vasp workflows in atomate?

Would suggest reorganizing into the following 3 lessons:

  1. Writing input files
  2. Parsing output files
  3. Database automation

2021 Advanced MongoDB Lesson Comments

Unclear Concepts

  • When using a sort operation while querying, it is unclear how documents are sorted when the sort key is a list.
    • i.e. when given the docs: [{'prize': [{'year': 1964}, {'year': 1967}]}, {'prize': [{'year': 1968}, {'year': 1963}]}, {'prize': [{'year': 1965}, {'year': 1972}]}], what will the sort look like? Does it use the first item in the list or does it sort the list first?
  • When is it disadvantageous to use add indexes to collections.
    • Are there certain data types (such as binary string) that would not be useful to have an index for?
    • Do indexes speed up regex operations?
    • Why not index everything?

Potentially Missing Concepts

  • Could touch on other mongodb operators such as $size and $all (currently only $elemMatch).
  • Updating or inserting documents (insert_one(), update_one(), insert_many(), update_many())
  • Mongo aggregation - a quick intro. Showing taught concepts and using aggregation

2021 Intro to MongoDB

Confusing or unclear

  • What is MongoDB? Where is it hosted?

** Additions**

  • $regex operator for basic text searches. No actual regex syntax necessary.
  • Introduce where the database we're using is hosted and briefly explain how someone could locally host a database.

We should probably not be teaching from personal forks of existing libraries.

@jmmshn @mkhorton

I was hoping to use the notebook viewer in my section but it looks like this is only available on Jimmy's fork and not in the released version of crystal_toolkit. I think this will be confusing to users when they go home and cannot find that functionality for their own personal setups.

Is there a reason we can't add this functionality into the released version of crystal_toolkit on Pypi?

2021 Materials Project Website Comments

Things that are confusing

  • Attendees may need an explanation of what the ICSD is (e.g. when discussing the "experimentally observed" flag)
  • Detail about elasticity data for dynamically unstable materials may be a little too much "in the weeds" for the walkthrough
  • A little confusing what kind of data users can expect to find in Battery and Molecules explorers that they won't find in the Materials Explorer
  • The similarity of the task page to the detail page may confuse attendees. Maybe showing multiple task pages would help? Maybe showing none at all?

Things to add

  • Demonstration of advanced searching features
    • Wildcard searches
    • Chemical system vs. elements searches
  • Description of the overall structure of the detail page
  • Discussion about transition to the new website
  • How workshop attendees can provide feedback on the new website
    • Perhaps a separate curated forum just for collecting this kind of feedback

2021 Matminer/Machine Learning Comments

Confusing

  • Some small typos/miswordings such as the semiconductor_df cells
  • citations method footnote does not show an example of how to use it, but it is very important
  • Part 3 of the notes does not give an overview of the ML model we will be creating, it just dives right into fitting a model
  • The Automatminer part at the end both does not work with the newest matminer and seems "tacked on" to an already long lesson and does not have corresponding exercises...

To add

  • an example of citations
  • add a brief explanation into Part 3 of the overall goal (fitting a model to predict bulk moduli)
  • Some mention of matbench, perhaps @mkhorton could direct how to proceed here

Other

  • Matminer notebook uses outdated version of matminer/must be updated to 0.7.2 as there were breaking changes in 0.7.3
  • Additionally with Figrecipes, as it is now its own repo - might be worth just using plotly express instead? Alternatively I can make Figrecipes its own pypi package and add it to the requirements...

2021 Reaction Networks / Exploring New Systems Comments

At the 2021 MP Workshop, the "Reaction Networks" lesson will replace the previous year's "Exploring New Systems" lesson. I will be taking some bits from the previous lesson and also adding many new concepts.

Confusing concepts

  • Some of the trickier phase diagram concepts were very quickly explained... what is "energy above hull" and connection with metastability? How is this related to chemical potential/predominance diagrams and why is any of this useful in synthesis?
  • How does a compound phase diagram differ from an interface reaction diagram?
  • How do you put a disordered structure on the phase diagram? i.e. what do you do after you run a bunch of disordered->ordered structures? How do we compare alloy structures to MP structures?

Things to keep

  • Querying MPRester for ComputedEntry objects within specific systems, based on more advanced element and target criteria
  • Building of DataFrames for examining the energetics of various targets / reactions
  • Exploration of the various types of phase diagrams and why you might use them (i.e. how they relate to synthesis)

Things to add

  • Use of interface reaction calculator for predicting most likely reactions
  • Chemical potential diagrams
  • Enumerators for assessing possible reactions
  • Reaction networks and coming up with possible balanced reaction pathways

Is there any possible way to get POSCAR file from Materials Project through MPRester?

Hi,

Thanks for your great work in these workshops.

Recently I was using pymatgen and MPI conducting some VASP calculation. For POSCAR file generation, I used MPRester() method to get the data of a specific material and write value 'cif' to a cif file and then using Poscar method to create a POSCAR file:

    with MPRester() as mpr:
        material = mpr.get_data('element')
        for item in material:
            if item['formation_energy_per_atom'] == 0.0:
                cif_name = element + '.cif'
                f_cif = open(cif_name, 'w+')
                f_cif.write(item['cif'])
                f_cif.close()
    struc = Structure.from_file(cif_name)
    Poscar(structure=struc).write_file('POSCAR') 

However, I found the POSCAR file generated this way is different from the POSCAR file downloaded directly from Materials Project. In a specific case, Ir (mp-101), VASP calculation failed on the basis of the POSCAR generated by the way mentioned above, but worked perfectly on the basis of the downloaded POSCAR file.

So I was wondering if there is a API way that we can get the POSCAR directly.

Can I upload the video in youtube to Chinese video platform?

Hello,

I'm a joint phd studet(PSU with HIT) from China. I notice that there are some wonderful videos about the workshop in youtube. However, in China, we can't log in youtube.

So can I upload these workshop videos to some Chinese video platform(e.g. Bilibili). Of course, all copyrights belongs to the MP developers and I will give the original link to youtube, this github reposite and MP's website.

Bests
Mingqing Liao

Intro to pymatgen comments

Confusing parts:

  • Species properties, are they freely definable or stored properties?
  • Constructing composition, what does the '50% Au 50% Cu' mean?

New components potentially useful:

  • Non-linear molecule construction, where bond angle is input parameter
  • After supercell transformation, create deformation structure
  • Create vacancy defect to structure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.