Giter VIP home page Giter VIP logo

periodic_table's People

Contributors

dependabot-preview[bot] avatar noirotm avatar victorkoenders avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

noirotm

periodic_table's Issues

Move generated code to OUT_DIR

When deploying cargo, we get the following error:

error: failed to verify package tarball

Caused by:
  Source directory was modified by build.rs during cargo publish. Build scripts should not modify anything outside of OUT_DIR.
Added: /home/trangar/development/rust/periodic_table/target/package/periodic_table-0.2.0/src/lib.rs

To proceed despite this, pass the `--no-verify` flag.

It would be nice if the build script wrote to OUT_DIR, and we had a normal lib.rs that included it with include!(concat!(env!("OUT_DIR"), "/elements.rs"));

Improve generator

  • Move src/main.rs to src/bin/generate.rs
  • Move the generated file to src/generated.rs
  • Parse the CSV directly into a CsvElement type that implements Debug to generate Element code
  • Introduce lazy_static!

Improve Element struct

Field type improvements

  • Symbol as an enum
  • Parse atomic_mass into an enum or struct
  • hex_colour can be just a (u8, u8, u8).
  • Parse electronic_configuration into an enum or struct
  • bonding_type can be an enum
  • group_block can be an enum

Field description

  • atomic_number
  • symbol
  • name
  • atomic_mass
  • cpk_hex_color
  • electronic_configuration
  • electronegativity
  • atomic_radius
  • ion_radius
  • van_del_waals_radius
  • ionization_energy
  • electron_affinity
  • oxidation_states
  • standard_state
  • bonding_type
  • melting_point (reference pressure)
  • boiling_point (reference pressure)
  • density
  • group_block
  • year_discovered

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.