Skip to content

Commit

Permalink
Merge pull request #95 from JensKrumsieck/spectroscopy-overhaul
Browse files Browse the repository at this point in the history
Spectroscopy overhaul
  • Loading branch information
JensKrumsieck authored Mar 1, 2023
2 parents 5341d93 + 8a93b2f commit 7bd9568
Show file tree
Hide file tree
Showing 98 changed files with 4,365 additions and 91,207 deletions.
2 changes: 1 addition & 1 deletion ChemSharp.Molecules.Blazor/BlazorBond.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChemSharp.Molecules.Blazor.Extension;
using ChemSharp.Molecules.Blazor.Extensions;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;

Expand Down
2 changes: 1 addition & 1 deletion ChemSharp.Molecules.Blazor/BlazorMolecule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChemSharp.Molecules.Blazor.Extension;
using ChemSharp.Molecules.Blazor.Extensions;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.JSInterop;
Expand Down
4 changes: 2 additions & 2 deletions ChemSharp.Molecules.Blazor/BlazorMoleculeFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChemSharp.Files;
using ChemSharp.Extensions;
using Microsoft.AspNetCore.Components.Forms;

namespace ChemSharp.Molecules.Blazor;
Expand All @@ -13,7 +13,7 @@ public static class BlazorMoleculeFactory
/// <returns></returns>
public static Molecule Create(IBrowserFile file, long maxFileSize = 8192000L)
{
var extension = FileHandler.GetExtension(file.Name);
var extension = FileUtil.GetExtension(file.Name);
var stream = file.OpenReadStream(maxFileSize);
return Molecule.FromStream(stream, extension);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.JSInterop;

namespace ChemSharp.Molecules.Blazor.Extension;
namespace ChemSharp.Molecules.Blazor.Extensions;

public static class JSInteropUtil
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Numerics;

namespace ChemSharp.Molecules.Blazor.Extension;
namespace ChemSharp.Molecules.Blazor.Extensions;

public static class MoleculeUtil
{
Expand Down
63 changes: 1 addition & 62 deletions ChemSharp.Molecules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,4 @@

[![NuGet Badge](https://buildstats.info/nuget/ChemSharp.Molecules?includePreReleases=true)](https://www.nuget.org/packages/ChemSharp.Molecules/)

Package for processing of molecule related files.

### Features

* Open and process Molecular files (see [Supported Filetypes](#supported-filetypes))
* Sum formula operations and elemental analysis calculation
* Using Elemental Data from https://github.com/JensKrumsieck/periodic-table
* Blazor
View: `ChemSharp.Molecules.Blazor` [![NuGet Badge](https://buildstats.info/nuget/ChemSharp.Molecules.Blazor?includePreReleases=true)](https://www.nuget.org/packages/ChemSharp.Molecules.Blazor/)

## Basic Usage

#### Create Molecules

Molecules can be created in a lot of ways. The easiest way is to use MoleculeFactory.Create, which accepts a string
path. Depending on the File extension the correct DataProvider is used to load the file.

```csharp
//Creates a molecule from cif file
const string path = "files/cif.cif";
var mol = MoleculeFactory.Create(path);
```

It is also possible to create a Molecule by using a specific DataProvider (e.g. if automatic detection fails or you only
want to support a selected number of file types)

```csharp
//You can also create molecules by selecting the provider yourself
const string path = "files/benzene.mol2";
var provider = new Mol2DataProvider(path);
var mol = new Molecule(provider);
```

You can also add [Atoms and Bonds](https://github.com/JensKrumsieck/ChemSharp/wiki/Element-Atom-Bond) as Lists if you
got the data from somewhere else.

```csharp
//...or by just adding the Atoms & Bonds as Lists
const string path = "files/cif.cif";
var provider = new CIFDataProvider(path);
var mol = new Molecule(provider.Atoms, provider.Bonds);
```

## Supported Files:

* **Import** (XYZ, CIF (crystallographic information file, CCDC), MOL2 (TRIPOS Mol2), PDB (Protein Data Bank file),
CDXML (Single Molecule only))
* **Export** (XYZ, MOL2)

<hr/>

#### Used Libraries:

* [MathNet.Numerics](https://github.com/mathnet/mathnet-numerics)

#### Compatibility

* .NET Standard 2.0, .NET Standard 2.1, .NET 5, .NET 6
* Unity (see [Wiki](https://github.com/JensKrumsieck/ChemSharp/wiki/Use-with-Unity)
<a href="https://github.com/JensKrumsieck/ChemSharp/wiki/Use-with-Unity"><img src="https://img.shields.io/badge/Unity-100000?logo=unity&logoColor=white"/></a>)
* Godot Engine (see [Wiki](https://github.com/JensKrumsieck/ChemSharp/wiki/Use-with-Godot-Engine) for Snippet)
* Blazor (see ChemSharp.Molecules.Blazor)
Package for processing of molecule related files.
64 changes: 0 additions & 64 deletions ChemSharp.Spectroscopy/DataProviders/BrukerEPRProvider.cs

This file was deleted.

141 changes: 0 additions & 141 deletions ChemSharp.Spectroscopy/DataProviders/BrukerNMRProvider.cs

This file was deleted.

56 changes: 0 additions & 56 deletions ChemSharp.Spectroscopy/DataProviders/GenericCSVProvider.cs

This file was deleted.

Loading

0 comments on commit 7bd9568

Please sign in to comment.