GithubHelp home page GithubHelp logo

multem.jl's Introduction

MULTEM

Stable Dev Build Status Build Status Coverage

This hopefully will become a Julia wrapper of the MULTEM simulation package for electron microsscopy. At the moment, this is used to test using TOML as an input file format.


Requirements

Juila: Downloads and Documentation

Installation

Open a Julia REPL, then press ] to use the package mode.

pkg> dev https://github.com/chenspc/MULTEM.jl

Go back to the normal mode by pressing backspace, then

julia> using MULTEM

There is a default.toml in the test folder, which can be imported as a dictionary simply with the TOML.jl package.

julia> using TOML

julia> default_toml = TOML.parsefile("default.toml")
Dict{String,Any} with 5 entries:
  "theory"     => Dict{String,Any}("electron_phonon_interaction"=>Dict{String,Any}("mode…
  "instrument" => Dict{String,Any}("incident_wave"=>Dict{String,Any}("psi"=>0.0,"theta"=…
  "specimen"   => Dict{String,Any}("rotation"=>Dict{String,Any}("theta"=>0.0,"center_typ
  "simulation" => Dict{String,Any}("output_region"=>Dict{String,Any}("ix_0"=>0.0,"iy_e"=
  "system"     => Dict{String,Any}("cpu_nthreads"=>1,"cpu_ncores"=>1,"device"=>2,"gpu_de…

This can then be converted to a more organised struct MULTEMInput for ease of use.

julia> m = from_dict(MULTEMInput, default_toml)
MULTEMInput()

Default values are by default not printed here, but those fields and values do exist. m can be converted back to a dictionary with to_dict. Use the include_defaults=true keyword if needed.

julia> m_dict = to_dict(m; include_defaults=true)
OrderedCollections.OrderedDict{String,Any} with 5 entries:
  "system"     => OrderedCollections.OrderedDict{String,Any}("cpu_nthreads"=>1,"cpu_ncor…
  "theory"     => OrderedCollections.OrderedDict{String,Any}("electron_phonon_interactio
  "simulation" => OrderedCollections.OrderedDict{String,Any}("output_region"=>OrderedCol
  "specimen"   => OrderedCollections.OrderedDict{String,Any}("rotation"=>OrderedCollecti
  "instrument" => OrderedCollections.OrderedDict{String,Any}("incident_wave"=>OrderedCol

Or use to_toml to generate a TOML string.

julia> m_toml = to_toml(m; include_defaults=true)
...
...

to_toml can also be used to directly save the TOML string to file.

julia> to_toml("/<some_path>/default_out.toml", m; include_defaults=true)

multem.jl's People

Contributors

chenspc avatar github-actions[bot] avatar

Watchers

 avatar  avatar

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.