Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ujihara committed Sep 30, 2018
2 parents b8a63b1 + 4a04577 commit e6ad4d9
Show file tree
Hide file tree
Showing 1,668 changed files with 24,763 additions and 25,004 deletions.
24 changes: 22 additions & 2 deletions BuildAll.bat
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
pushd NCDK
dotnet add package MathNet.Numerics.Signed
dotnet add package dotNetRDF
<<<<<<< HEAD
call :BuildProject NCDK
=======
dotnet restore
call :BuildProject NCDK yes
>>>>>>> develop
popd

pushd NCDKDisplay
call :BuildProject NCDK.Display
call :BuildProject NCDK.Display yes
popd

pushd NCDKTests
call :BuildProject NCDKTests
popd

pushd NCDKDisplayTests
call :BuildProject NCDK.DisplayTests
popd

goto END

:BuildProject

set ProjectName=%1
set NuGetOption=%2
if "%ProjectName%" == "" exit 1
if "%NuGetOption%" == "yes" set NuGetOption=%1
MSBuild "%ProjectName%.csproj" /t:Build /p:Configuration=Release
nuget pack "%ProjectName%.nuspec" -Prop Configuration=Release -IncludeReferencedProjects

if "%NuGetOption%" == "" goto SkipNuGet
nuget pack "%NuGetOption%.nuspec" -Prop Configuration=Release -IncludeReferencedProjects
if "%MyNuGetDir%" neq "" (
xcopy /D /Y "*.nupkg" "%MyNuGetDir%"
del /Q "*.nupkg"
)
:SkipNuGet

set ProjectName=
set NuGetOption=

exit /b

Expand Down
13 changes: 7 additions & 6 deletions ChemObjectConfig.ttinclude
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#
/*
* Copyright (C) 2017 Kazuya Ujihara <ujihara.kazuya@gmail.com>
* Copyright (C) 2017-2018 Kazuya Ujihara <ujihara.kazuya@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
Expand All @@ -21,6 +21,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#>

<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ output extension=".tt.cs" #>
<#@ Assembly Name="System.Core.dll" #>
Expand Down Expand Up @@ -75,23 +76,23 @@
/// <summary>
/// A dictionary for the storage of any kind of properties of this object.
/// </summary>
IDictionary<object, object> properties;
private Dictionary<object, object> properties;

private void InitProperties()
{
properties = new Dictionary<object, object>();
}

/// <inheritdoc/>
public virtual void SetProperty(object description, object property)
public virtual void SetProperty(object description, object value)
{
#if DEBUG
if (description != null && !AcceptablePropertyKeyTypes.Contains(description.GetType()))
throw new System.Exception();
#endif
if (this.properties == null)
InitProperties();
properties[description] = property;
properties[description] = value;
<#+ if (addNofityChanged) { #>
NotifyChanged();
<#+ } #>
Expand Down Expand Up @@ -137,10 +138,10 @@
return defaultValue;
}

private static readonly IDictionary<object, object> emptyProperties = new System.Collections.ObjectModel.ReadOnlyDictionary<object, object>(new Dictionary<object, object>(0));
private static readonly IReadOnlyDictionary<object, object> emptyProperties = NCDK.Common.Collections.Dictionaries.Empty<object, object>();

/// <inheritdoc/>
public virtual IDictionary<object, object> GetProperties()
public virtual IReadOnlyDictionary<object, object> GetProperties()
{
if (this.properties == null)
return emptyProperties;
Expand Down
18 changes: 14 additions & 4 deletions Config.ttinclude
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,25 @@ foreach (var s in entities)
}

public static explicit operator <#= name #>(int ordinal)
{
return To<#= name #>(ordinal);
}

public static <#= name #> To<#= name #>(int ordinal)
{
if (!(0 <= ordinal && ordinal < values.Length))
throw new System.ArgumentOutOfRangeException();
throw new System.ArgumentOutOfRangeException(nameof(ordinal));
return values[ordinal];
}

public static explicit operator int(<#= name #> obj)
public static explicit operator int(<#= name #> o)
{
return ToInt32(o);
}

public static int ToInt32(<#= name #> o)
{
return obj.Ordinal;
return o.Ordinal;
}

<#+
Expand Down Expand Up @@ -196,7 +206,7 @@ foreach (var s in entities)
<#= OName(s) #>,
<#+ } #>
};
public static <#= name #>[] Values => values;
public static System.Collections.Generic.IReadOnlyList<<#= name #>> Values => values;

<#+
if (isStruct)
Expand Down
12 changes: 6 additions & 6 deletions ExampleCodes/Aromaticities/Aromaticity_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void Main(string[] args)
var molecules = new Silent.AtomContainerSet();
#region
ElectronDonation model = ElectronDonation.DaylightModel;
ICycleFinder cycles = Cycles.Or(Cycles.AllFinder, Cycles.GetAllFinder(6));
ICycleFinder cycles = Cycles.Or(Cycles.AllSimpleFinder, Cycles.GetAllFinder(6));
Aromaticity aromaticity = new Aromaticity(model, cycles);

// apply our configured model to each molecule
Expand All @@ -30,14 +30,14 @@ public static void Main(string[] args)
// mimics the DoubleBondAcceptingAromaticityDetector
Aromaticity aromaticity_exo = new Aromaticity(ElectronDonation.CDKAllowingExocyclicModel, Cycles.CDKAromaticSetFinder);
// a good model for writing SMILES
Aromaticity aromaticity_smi = new Aromaticity(ElectronDonation.DaylightModel, Cycles.AllFinder);
Aromaticity aromaticity_smi = new Aromaticity(ElectronDonation.DaylightModel, Cycles.AllSimpleFinder);
// a good model for writing MDL/Mol2
Aromaticity aromaticity_mdl = new Aromaticity(ElectronDonation.PiBondsModel, Cycles.AllFinder);
Aromaticity aromaticity_mdl = new Aromaticity(ElectronDonation.PiBondsModel, Cycles.AllSimpleFinder);
#endregion
}
{
#region FindBonds
Aromaticity aromaticity = new Aromaticity(ElectronDonation.CDKModel, Cycles.AllFinder);
Aromaticity aromaticity = new Aromaticity(ElectronDonation.CDKModel, Cycles.AllSimpleFinder);
IAtomContainer container = TestMoleculeFactory.MakeAnthracene();
AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
try
Expand All @@ -53,7 +53,7 @@ public static void Main(string[] args)
}
{
#region Apply
Aromaticity aromaticity = new Aromaticity(ElectronDonation.CDKModel, Cycles.AllFinder);
Aromaticity aromaticity = new Aromaticity(ElectronDonation.CDKModel, Cycles.AllSimpleFinder);
IAtomContainer container = TestMoleculeFactory.MakeAnthracene();
try
{
Expand All @@ -75,7 +75,7 @@ public static void Main(string[] args)
}
{
#region CDKLegacy_AllFinder_RelevantFinder
new Aromaticity(ElectronDonation.CDKModel, Cycles.Or(Cycles.AllFinder, Cycles.RelevantFinder));
new Aromaticity(ElectronDonation.CDKModel, Cycles.Or(Cycles.AllSimpleFinder, Cycles.RelevantFinder));
#endregion
}
}
Expand Down
6 changes: 3 additions & 3 deletions ExampleCodes/Config/XMLIsotopeFactory_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace NCDK.Config
{
public class XMLIsotopeFactory_Example
public static class XMLIsotopeFactory_Example
{
public void Main()
public static void Main()
{
{
#region 1
Expand All @@ -13,7 +13,7 @@ public void Main()
}
{
#region example
IsotopeFactory factory = XMLIsotopeFactory.GetInstance(Default.ChemObjectBuilder.Instance);
IsotopeFactory factory = XMLIsotopeFactory.GetInstance(ChemObjectBuilder.Instance);
IIsotope major = factory.GetMajorIsotope("H");
#endregion
}
Expand Down
7 changes: 4 additions & 3 deletions ExampleCodes/ConformerContainer_Example.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
using NCDK.IO.Iterator;
using NCDK.Silent;
using System.IO;

namespace NCDK
{
public class ConformerContainer_Example
public static class ConformerContainer_Example
{
public void Ctor()
public static void Ctor()
{
string filename = null;
#region
var reader = new IEnumerableMDLConformerReader(
new FileStream(filename, FileMode.Open),
Default.ChemObjectBuilder.Instance);
ChemObjectBuilder.Instance);
foreach (ConformerContainer cc in reader)
{
foreach (var conformer in cc)
Expand Down
8 changes: 4 additions & 4 deletions ExampleCodes/ExampleCodes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<Compile Include="Fingerprints\PubchemFingerprinter_Example.cs" />
<Compile Include="Fingerprints\HybridizationFingerprinter_Example.cs" />
<Compile Include="Fingerprints\Fingerprinter_Example.cs" />
<Compile Include="ForceField\MMFF\MmffAtomTypeMatcher_Example.cs" />
<Compile Include="ForceField\MMFF\Mmff_Example.cs" />
<Compile Include="ForceFields\MmffAtomTypeMatcher_Example.cs" />
<Compile Include="ForceFields\Mmff_Example.cs" />
<Compile Include="Formula\FullEnumerationFormulaGenerator_Example.cs" />
<Compile Include="Formula\MolecularFormulaGenerator_Example.cs" />
<Compile Include="Geometries\Alignments\KabschAlignment_Example.cs" />
Expand Down Expand Up @@ -135,11 +135,12 @@
<Compile Include="Smiles\CDKToBeam_Example.cs" />
<Compile Include="Smiles\SMARTS\Parser\SMARTSParser_Example.cs" />
<Compile Include="Smiles\SMARTS\Parser\SmartsQueryVisitor_Example.cs" />
<Compile Include="SMARTS\SmartsFragmentExtractor_Example.cs" />
<Compile Include="Smiles\SMARTS\SmartsPattern_Example.cs" />
<Compile Include="Smiles\SMARTS\SMARTSQueryTool_Example.cs" />
<Compile Include="Smiles\SmilesGenerator_Example.cs" />
<Compile Include="Smiles\SmilesParser_Example.cs" />
<Compile Include="SMSD\Algorithms\RGraph\CDKMCS_Example.cs" />
<Compile Include="SMSD\Algorithms\RGraphs\CDKMCS_Example.cs" />
<Compile Include="SMSD\Isomorphism_Example.cs" />
<Compile Include="Stereo\Stereocenters_Example.cs" />
<Compile Include="Stereo\StereoElementFactory_Example.cs" />
Expand Down Expand Up @@ -174,7 +175,6 @@
<Name>NCDK</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion ExampleCodes/Fingerprints/Fingerprinter_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void Main()
var molecule = new AtomContainer();
var fingerprinter = new Fingerprinter();
var fingerprint = fingerprinter.GetBitFingerprint(molecule);
Console.WriteLine(fingerprint.Count); // returns 1024 by default
Console.WriteLine(fingerprint.Length); // returns 1024 by default
#endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void Main()
var molecule = new AtomContainer();
var fingerprinter = new HybridizationFingerprinter();
var fingerprint = fingerprinter.GetBitFingerprint(molecule);
Console.WriteLine(fingerprint.Count); // returns 1024 by default
Console.WriteLine(fingerprint.Length); // returns 1024 by default
#endregion
}
}
Expand Down
4 changes: 2 additions & 2 deletions ExampleCodes/Fingerprints/PubchemFingerprinter_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace NCDK.Fingerprints
{
public class PubchemFingerprinter_Example
{
public void Main()
public static void Main()
{
{
#region
var molecule = new AtomContainer();
IFingerprinter fingerprinter = new PubchemFingerprinter(Silent.ChemObjectBuilder.Instance);
IBitFingerprint fingerprint = fingerprinter.GetBitFingerprint(molecule);
Console.WriteLine(fingerprint.Count); // returns 881
Console.WriteLine(fingerprint.Length); // returns 881
#endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void Main()
AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(molecule);
var fingerprinter = new ShortestPathFingerprinter();
var fingerprint = fingerprinter.GetBitFingerprint(molecule);
Console.WriteLine(fingerprint.Count); // returns 1024 by default
Console.WriteLine(fingerprint.Length); // returns 1024 by default
#endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace NCDK.ForceField.MMFF
namespace NCDK.ForceFields
{
class MmffAtomTypeMatcher_Example
static class MmffAtomTypeMatcher_Example
{
void Main()
static void Main()
{
IChemObjectSet<IAtomContainer> containers = null;
#region
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using NCDK.Templates;

namespace NCDK.ForceField.MMFF
namespace NCDK.ForceFields
{
public class Mmff_Example
public static class Mmff_Example
{
public void Main()
public static void Main()
{
{
#region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public void Main()
{
IChemObjectBuilder builder = null;
#region
IsotopeFactory ifac = Isotopes.Instance;
IsotopeFactory ifac = BODRIsotopeFactory.Instance;
IIsotope c = ifac.GetMajorIsotope("C");
IIsotope h = ifac.GetMajorIsotope("H");
IIsotope n = ifac.GetMajorIsotope("N");
Expand Down
2 changes: 1 addition & 1 deletion ExampleCodes/Formula/MolecularFormulaGenerator_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MolecularFormulaGenerator_Example
public void Main()
{
#region
IsotopeFactory ifac = Isotopes.Instance;
IsotopeFactory ifac = BODRIsotopeFactory.Instance;
IIsotope c = ifac.GetMajorIsotope("C");
IIsotope h = ifac.GetMajorIsotope("H");
IIsotope n = ifac.GetMajorIsotope("N");
Expand Down
8 changes: 4 additions & 4 deletions ExampleCodes/Geometries/Alignments/KabschAlignment_Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace NCDK.Geometries.Alignments
{
public class KabschAlignment_Example
public static class KabschAlignment_Example
{
public void Main()
public static void Main()
{
{
#region
AtomContainer ac1 = new AtomContainer(); // molecule 1
AtomContainer ac2 = new AtomContainer(); // molecule 2
var ac1 = new AtomContainer(); // molecule 1
var ac2 = new AtomContainer(); // molecule 2
try
{
KabschAlignment sa = new KabschAlignment(ac1.Atoms, ac2.Atoms);
Expand Down
Loading

0 comments on commit e6ad4d9

Please sign in to comment.