Molecules 1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Molecules --version 1.0.0
NuGet\Install-Package Molecules -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Molecules" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Molecules --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Molecules, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Molecules as a Cake Addin #addin nuget:?package=Molecules&version=1.0.0 // Install Molecules as a Cake Tool #tool nuget:?package=Molecules&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Molecules:
- Molecules is a class library targeting the .NETStandard 2.0 and 2.1, and is also available as a Nuget package.
- Simply reference the library/package as preferred, and add the below using
using Molecules;
Elements:
- Instances of the
Element
class represent chemical elements. - 118 static instance are provided on this class, allowing easy access to elements.
Element
also implementsIEquatable<Element>
using property comparison.
var hydrogen = Element.H;
Console.WriteLine(hydrogen);
// Output: 1 Hydrogen (H)
Element Collections:
- The
ElementCollection
class implementsICollection<Element>
but also provides indexers for easy access. ElementCollection
contains a static memberElementCollection.PeriodicTable
which is anElementCollection
formed with the 118 elements mentioned above..
var hydrogen = ElementCollection.PeriodicTable["H"]; // Access by symbol
var oxygen = ElementCollection.PeriodicTable[8]; // Access by atomic number.
var carbon = ElementCollection.PeriodicTable[12.0107] // Access by atomic mass.
var nitrogen = ElementCollection.GetByName("Nitrogen"); // Note that this method is case insensitive.
Console.WriteLine(hydrogen);
Console.WriteLine(oxygen);
Console.WriteLine(carbon);
Console.WriteLine(nitrogen);
// Output:
// 1 Hydrogen (H)
// 8 Oxygen (O)
// 6 Carbon (C)
// 7 Nitrogen (N)
Molecules:
- The
Molecule
class is the core of the project. - It contains no public constructors, but does have static methods:
Molecule.Parse()
andMolecule.TryParse()
for parsing strings containing chemical formulae. - The format of strings to be parsed is as follows:
- The string may contain letters in either upper or lower case, digits and parentheses - "(" and ")".
- The character after any parentheses must be a digit or be upper case.
- Nested parentheses are not yet supported.
- By default, the parsing methods will use
ElementCollection.PeriodicTable
as a reference, but there are overloads to allow users to define anElementCollection
to use instead.
var water = Molecule.Parse("H2O");
Console.WriteLine(water.Mass);
// Output: 18.01528
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.