keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
3D
antecede/EZSpecificity
Datasets/Structure/structure.py
.py
14,060
369
import os import pickle import lmdb import torch from torch.utils.data import Dataset from tqdm.auto import tqdm from easydict import EasyDict import yaml import sys import ray root_dir = "/projects/bbto/suyufeng/enzyme_specificity" sys.path.append(f"{root_dir}/src") from Datasets.utils import get_paths, check_paths_...
Python
3D
antecede/EZSpecificity
Datasets/Structure/preprocess.ipynb
.ipynb
482,058
9,671
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import glob\n", "import sys\n", "from tqdm import tqdm\n", "import os\n", "\n", "root_dir = \"/projects/bbhh/suyufeng/enzyme_specificity\"\n", "\n", "sys.path.append(f\...
Unknown
3D
antecede/EZSpecificity
Datasets/Structure/collator.py
.py
5,668
148
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch import numpy as np def pad_1d_unsqueeze(x, padlen): x = x + 1 # pad id = 0 xlen = x.size(0) if xlen < padlen: new_x = x.new_zeros([padlen], dtype=x.dtype) new_x[:xlen] = x x = new_x return x....
Python
3D
antecede/EZSpecificity
Datasets/Structure/transforms.py
.py
7,875
182
import sys root_dir = "/projects/bbto/suyufeng/enzyme_specificity" sys.path.append(f"{root_dir}/src") import torch import torch.nn.functional as F import numpy as np from rdkit.Chem.rdchem import BondType from Datasets.Structure.utils import StructureComplexData from Datasets.Structure.protein_ligand import ATOM_FE...
Python
3D
antecede/EZSpecificity
Datasets/Specific_familty/other_small_family.ipynb
.ipynb
36,262
886
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import sys\n", "from collections import defaultdict\n", "import random\n", "\n", "data_root_dir = \"/projects/bbto/suyufeng/enzyme_specificity\"\n", ...
Unknown
3D
antecede/EZSpecificity
Datasets/Specific_familty/halogenase.ipynb
.ipynb
30,465
706
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import sys\n", "from collections import defaultdict\n", "import random\n", "\n", "root_dir = \"/projects/bbto/suyufeng/enzyme_specificity\"\n", "sy...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
Panel.cpp
.cpp
4,770
216
#include "StdAfx.h" #include "Panel.h" #include "Histogram.h" #include "Resource.h" #include "MainFrm.h" #include "DICOM ViewerDoc.h" BEGIN_MESSAGE_MAP(CPanel, CDockablePane) ON_WM_PAINT() ON_WM_SIZE() ON_WM_ERASEBKGND() ON_WM_MOUSEMOVE() ON_WM_LBUTTONDOWN() ON_WM_LBUTTONUP() ON_WM_CREATE() ON_WM_DESTROY() O...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
graph.h
.h
17,233
507
/* graph.h */ /* This software library implements the maxflow algorithm described in "An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Vision." Yuri Boykov and Vladimir Kolmogorov. In IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), September 2004 ...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
Scale.cpp
.cpp
679
34
#include "stdafx.h" #include "Scale.h" #include "MainFrm.h" #include "Panel.h" #include "Spectrum.h" #include "DICOM ViewerDoc.h" void DICOMtoImage(int min, int max) { int value, x, y, z; for (z=0; z<512; z++) for (y=0; y<512; y++) for (x=0; x<512; x++) { value = 255 * 2.5 * (m_DicomData[z][y][x]- min)...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
SpectrumPoint.cpp
.cpp
378
26
#include "StdAfx.h" #include "SpectrumPoint.h" SpectrumPoint::SpectrumPoint(void) { m_bExist = false; m_bDrag = false; m_bFixed = false; } SpectrumPoint::~SpectrumPoint(void) { } bool SpectrumPoint::InsideRect(int x, int y) { if((m_rt.left <= x)&&(x <= m_rt.right) &&(m_rt.top <= y)&&(y <= m_rt.bottom)) { ...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
RendererSeg.h
.h
1,741
71
#pragma once #include <glm/glm.hpp> #include "DICOM ViewerView.h" #include "TranformationMgr.h" #include "glsl.h" using namespace cwc; class RendererSeg { public: RendererSeg(void); ~RendererSeg(void); bool Initialize(); bool SetParent(CScrollView* _parent); void Destroy(); void Resize( int cx, int cy); v...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
TranformationMgr.cpp
.cpp
1,251
42
#include "StdAfx.h" #include "TranformationMgr.h" #include <GL/GL.h> CTranformationMgr::CTranformationMgr(void) { mdRotation[0]=mdRotation[5]=mdRotation[10]=mdRotation[15] = 1.0f; mdRotation[1]=mdRotation[2]=mdRotation[3]=mdRotation[4] = 0.0f; mdRotation[6]=mdRotation[7]=mdRotation[8]=mdRotation[9] = 0.0f...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
TranformationMgr.h
.h
401
21
#pragma once class CTranformationMgr { public: CTranformationMgr(void); virtual ~CTranformationMgr(void); const double* GetMatrix() { return mdRotation; } // Call this only after the open gl is initialized. void Rotate(float fx_i, float fy_i, float fz_i ); void ResetRotation(); ...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
segmentation.h
.h
3,796
153
#include "stdio.h" #include <math.h> #include <cstdio> #include <vector> #include "MarchingCube.h" #if 0 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" #include "itkGradientMagnitudeRecursiveGaussianImageFilter.h" #include "itkSigmoidImageFilter.h" #include "itkFastMarchingImageFilter.h" #include "itkShap...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
MarchingCube.h
.h
1,273
77
#include "stdio.h" #include <math.h> #include <cstdio> #include <vector> #pragma once #define sizex 512 #define sizey 512 typedef struct vector_T { float fX; float fY; float fZ; } tVector; typedef struct facet_T { float normal[3]; float v1[3]; float v2[3]; float v3[3]; } facet; typedef struct...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
RendererSeg.cpp
.cpp
25,635
916
#include "StdAfx.h" #include "RendererSeg.h" #include "DICOM ViewerDoc.h" #include "MainFrm.h" //#include "glsl.h" #include <glm/gtc/matrix_transform.hpp> #define M_PI 3.14159265358979323846 void CreateRotationalMatrix(double** matrix, double phi, double theta, double psi) { matrix[0][0] = cos(theta)*cos(psi)...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
Camera.h
.h
1,576
68
//*************************************************************************** // // Advanced CodeColony Camera // Philipp Crocoll, 2003 // //*************************************************************************** #pragma once //#include <gl\glut.h> // Need to include it here because the GL* types are required #de...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
RendererHelper.h
.h
1,233
57
#pragma once #include "DICOM ViewerView.h" #include "Camera.h" class CRawDataProcessor; class CTranformationMgr; class CRendererHelper { public: CRendererHelper(void); virtual ~CRendererHelper(void); bool Initialize( HDC hContext_i, CRawDataProcessor* pRawDataProc_i); void Resize( int nWidth_i, int nH...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
picking.cpp
.cpp
4,037
132
#include "StdAfx.h" #include "picking.h" //#include <glm/gtc/matrix_transform.hpp> // ///*----------------------------------------------- // //Name: GetColorByIndex // //Params: index - index of color you want to generate // //Result: Returns i-th RGB color. // ///*---------------------------------------------*/ ...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
graph.cpp
.cpp
2,935
116
/* graph.cpp */ #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include "graph.h" template <typename captype, typename tcaptype, typename flowtype> Graph<captype, tcaptype, flowtype>::Graph(int node_num_max, int edge_num_max, void (*err_function)(char *)) : node_num(0), nodeptr_...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
block.h
.h
7,220
269
/* block.h */ /* Template classes Block and DBlock Implement adding and deleting items of the same type in blocks. If there there are many items then using Block or DBlock is more efficient than using 'new' and 'delete' both in terms of memory and time since (1) On some systems there is some minimum amount of me...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
Panel.h
.h
1,165
52
#pragma once #include "afxdockablepane.h" #include "Histogram.h" #include "Spectrum.h" enum PANEL_MODE { PANEL_NONE, PANEL_THRES, PANEL_A_THRES, PANEL_GRAPH_CUT, PANEL_LEVEL_SET }; class CPanel : public CDockablePane { public: afx_msg void OnThreshold(); afx_msg void OnAThreshold(); afx_msg void OnGraphCut()...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
FilterLevelSet.h
.h
103
9
#pragma once class FilterLevelSet { public: FilterLevelSet(void); ~FilterLevelSet(void); };
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
Camera.cpp
.cpp
4,467
195
#include "StdAfx.h" #include "camera.h" #include "math.h" #include <iostream> #include "windows.h" #define SQR(x) (x*x) #define NULL_VECTOR F3dVector(0.0f,0.0f,0.0f) SF3dVector F3dVector ( GLfloat x, GLfloat y, GLfloat z ) { SF3dVector tmp; tmp.x = x; tmp.y = y; tmp.z = z; return tmp; } GLfloat GetF3dVectorLe...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
segmentation.cpp
.cpp
46,760
1,929
#include "stdafx.h" #include "segmentation.h" #include "Scale.h" #include "graph.h" #include "block.h" #include "itkCurvatureAnisotropicDiffusionImageFilter.h" #include "itkGradientMagnitudeRecursiveGaussianImageFilter.h" #include "itkSigmoidImageFilter.h" #include "itkFastMarchingImageFilter.h" #include "itkShapeDet...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
MarchingCube.cpp
.cpp
28,187
535
#include "stdafx.h" #include "MarchingCube.h" #include "Scale.h" #include "DICOM ViewerDoc.h" #include "MainFrm.h" //a2fVertexOffset lists the positions, relative to vertex0, of each of the 8 vertices of a cube static const float a2fVertexOffset[8][3] = { {0.0, 0.0, 0.0},{1.0, 0.0, 0.0},{1.0, 1.0, 0.0},{0.0, 1.0,...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
glsl.cpp
.cpp
50,247
1,971
/******************************************************************** glsl.cpp Version: 1.0.0_rc5 Last update: 2006/11/12 (Geometry Shader Support) (c) 2003-2006 by Martin Christen. All Rights reserved. *********************************************************************/ #include "stdAfx.h" #include "glsl.h" #inclu...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
FilterAthres.h
.h
97
9
#pragma once class FilterAthres { public: FilterAthres(void); ~FilterAthres(void); };
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
Scale.h
.h
80
7
COLORREF GetKeyColor(int input); void DICOMtoImage(int min, int max);
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
glsl.h
.h
23,617
327
/****************************************************************************** glsl.h Version: 1.0.0_rc5 Last update: 2006/11/14 (c) 2003-2006 by Martin Christen. All Rights reserved. ******************************************************************************/ /*! \page libglslnews What's new in libglsl \section...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
RendererHelper.cpp
.cpp
9,999
363
#include "StdAfx.h" #include "RendererHelper.h" #include "RawDataProcessor.h" #include "TranformationMgr.h" #include "MainFrm.h" #include "DICOM ViewerDoc.h" GLfloat dOrthoSize = 1.0f; CRendererHelper::CRendererHelper(void) : m_pRawDataProc(NULL),m_zoom(1.0) { AspectRatio = 1; for(int i = 0; i < 3; i++) { ...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
SpectrumPoint.h
.h
320
19
#pragma once class SpectrumPoint { public: SpectrumPoint(void); ~SpectrumPoint(void); bool InsideRect(int x, int y); void SetFixed(bool _bFixed){ m_bFixed = _bFixed; } bool GetFixed(){ return m_bFixed; } CRect m_rt; COLORREF m_color; bool m_bExist; bool m_bDrag; private: bool m_bFixed; };
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
RawDataProcessor.h
.h
705
44
#pragma once // CRawDataProcessor class CDICOMViewerDoc; class CRawDataProcessor { public: CRawDataProcessor(); virtual ~CRawDataProcessor(); // Call this only after the open gl is initialized. bool ReadFile(CDICOMViewerDoc* _pDoc, int nWidth_i, int nHeight_i, int nSlices_i ); int GetTexture3D() { ...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
maxflow.cpp
.cpp
14,906
685
/* maxflow.cpp */ #include "stdafx.h" #include <stdio.h> #include "graph.h" /* special constants for node->parent */ #define TERMINAL ( (arc *) 1 ) /* to terminal */ #define ORPHAN ( (arc *) 2 ) /* orphan */ #define INFINITE_D ((int)(((unsigned)-1)/2)) /* infinite distance to the terminal */ /**************...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
picking.h
.h
334
10
#pragma once //#include <glm/glm.hpp> // //glm::vec4 GetColorByIndex(int index); //int GetIndexByColor(int r, int g, int b); //int GetPickedColorIndexUnderMouse(); // //void Get3DRayUnderMouse(glm::vec3* v1, glm::vec3* v2); //bool RaySphereCollision(glm::vec3 vSphereCenter, float fSphereRadius, glm::vec3 vA, glm::vec3...
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
FilterGraphCut.h
.h
103
9
#pragma once class FilterGraphCut { public: FilterGraphCut(void); ~FilterGraphCut(void); };
Unknown
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
RawDataProcessor.cpp
.cpp
3,028
93
#include "StdAfx.h" #include "RawDataProcessor.h" #include "DICOM ViewerDoc.h" #include "Scale.h" CRawDataProcessor::CRawDataProcessor(void) : m_uImageWidth(0) ,m_uImageHeight(0) ,m_uImageCount(0) ,m_nTexId(0) { } CRawDataProcessor::~CRawDataProcessor(void) { // If not initialized, then this will be zero. So no ch...
C++
3D
IACT-Medical-Image-Processing/DICOM-3D-Viewer
FilterThres.h
.h
94
9
#pragma once class FilterThres { public: FilterThres(void); ~FilterThres(void); };
Unknown
3D
feos-org/feos
CHANGELOG.md
.md
12,666
182
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Packaging - Updated `quantity` dependency to 0.1...
Markdown
3D
feos-org/feos
py-feos/src/estimator.rs
.rs
23,544
742
use crate::eos::PyEquationOfState; use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::residual::ResidualModel; use crate::PyVerbosity; use feos::estimator::{ BinaryPhaseDiagram, BinaryVleChemicalPotential, BinaryVlePressure, DataSet, Diffusion, EquilibriumLiquidDensity, Estimator, Li...
Rust
3D
feos-org/feos
py-feos/src/lib.rs
.rs
3,980
132
#![warn(clippy::all)] #![warn(clippy::allow_attributes)] use feos_core::Verbosity; use pyo3::prelude::*; #[cfg(feature = "ad")] pub(crate) mod ad; #[cfg(feature = "dft")] pub(crate) mod dft; pub(crate) mod eos; pub(crate) mod error; // pub(crate) mod estimator; pub(crate) mod ideal_gas; pub(crate) mod parameter; pub(c...
Rust
3D
feos-org/feos
py-feos/src/state.rs
.rs
53,537
1,686
use crate::eos::parse_molefracs; use crate::{ PyVerbosity, eos::PyEquationOfState, error::PyFeosError, ideal_gas::IdealGasModel, residual::ResidualModel, }; use feos_core::{ Contributions, DensityInitialization, EquationOfState, FeosError, ResidualDyn, State, StateVec, }; use ndarray::{Array1, Array2}; use ...
Rust
3D
feos-org/feos
py-feos/src/ideal_gas.rs
.rs
602
22
//! Collection of ideal gas models. use crate::user_defined::PyIdealGas; use feos::ideal_gas::{Dippr, Joback}; use feos_core::IdealGas; use feos_derive::IdealGas; use num_dual::DualNum; use std::sync::Arc; /// Collection of different [IdealGas] implementations. /// /// Particularly relevant for situations in which gen...
Rust
3D
feos-org/feos
py-feos/src/error.rs
.rs
555
24
use feos_core::FeosError; use pyo3::exceptions::PyRuntimeError; use pyo3::prelude::*; use thiserror::Error; #[derive(Debug, Error)] pub enum PyFeosError { #[error("{0}")] Error(String), #[error(transparent)] FeosError(#[from] FeosError), #[error(transparent)] Serde(#[from] serde_json::Error), ...
Rust
3D
feos-org/feos
py-feos/src/residual.rs
.rs
3,663
117
use feos_core::cubic::PengRobinson; use feos_core::*; #[cfg(feature = "dft")] use feos_derive::{FunctionalContribution, HelmholtzEnergyFunctionalDyn}; use feos_derive::{ResidualDyn, Subset}; #[cfg(feature = "dft")] use feos_dft::{FunctionalContribution, HelmholtzEnergyFunctionalDyn}; use indexmap::IndexMap; use nalgebr...
Rust
3D
feos-org/feos
py-feos/src/user_defined.rs
.rs
11,649
344
#![allow(non_snake_case)] use feos_core::{IdealGas, Molarweight, ResidualDyn, StateHD, Subset}; use nalgebra::DVector; use num_dual::*; use numpy::{PyArray, PyReadonlyArrayDyn, PyReadwriteArrayDyn}; use pyo3::exceptions::PyTypeError; use pyo3::prelude::*; use quantity::MolarWeight; use std::any::Any; pub struct PyIdea...
Rust
3D
feos-org/feos
py-feos/src/phase_equilibria.rs
.rs
53,628
1,468
use crate::{ PyVerbosity, eos::{PyEquationOfState, parse_molefracs}, error::PyFeosError, ideal_gas::IdealGasModel, residual::ResidualModel, state::{PyContributions, PyState, PyStateVec}, }; use feos_core::{ Contributions, EquationOfState, PhaseDiagram, PhaseDiagramHetero, PhaseEquilibrium, R...
Rust
3D
feos-org/feos
py-feos/src/ad/mod.rs
.rs
8,150
234
use feos::pcsaft::{PcSaftBinary, PcSaftPure}; use feos_core::{ParametersAD, PropertiesAD}; use numpy::{PyArray1, PyArray2, PyReadonlyArray2, ToPyArray}; use paste::paste; use pyo3::prelude::*; #[pyclass(name = "EquationOfStateAD", eq, eq_int)] #[derive(Clone, Copy, PartialEq)] pub enum PyEquationOfStateAD { PcSaft...
Rust
3D
feos-org/feos
py-feos/src/eos/mod.rs
.rs
7,499
228
use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::residual::ResidualModel; use feos_core::*; use indexmap::IndexMap; use nalgebra::{DVector, DVectorView, Dyn}; use numpy::{PyArray1, PyReadonlyArray1, ToPyArray}; use pyo3::prelude::*; use quantity::*; use std::ops::Div; use std::sync::Arc; ...
Rust
3D
feos-org/feos
py-feos/src/eos/constructors.rs
.rs
3,906
128
use super::PyEquationOfState; use crate::ideal_gas::IdealGasModel; use crate::parameter::{PyGcParameters, PyParameters}; use crate::residual::ResidualModel; use crate::user_defined::{PyIdealGas, PyResidual}; use feos::ideal_gas::{Dippr, Joback}; use feos_core::cubic::PengRobinson; use feos_core::*; use pyo3::prelude::*...
Rust
3D
feos-org/feos
py-feos/src/eos/epcsaft.rs
.rs
2,683
70
use super::PyEquationOfState; use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::parameter::PyParameters; use crate::residual::ResidualModel; use feos::epcsaft::{ElectrolytePcSaft, ElectrolytePcSaftOptions, ElectrolytePcSaftVariants}; use feos_core::{EquationOfState, ResidualDyn}; use pyo3::...
Rust
3D
feos-org/feos
py-feos/src/eos/pets.rs
.rs
2,669
79
use super::PyEquationOfState; #[cfg(feature = "dft")] use crate::dft::{PyFMTVersion, PyHelmholtzEnergyFunctional}; use crate::{ideal_gas::IdealGasModel, parameter::PyParameters, residual::ResidualModel}; use feos::pets::{Pets, PetsOptions}; use feos_core::{EquationOfState, ResidualDyn}; use pyo3::prelude::*; use std::s...
Rust
3D
feos-org/feos
py-feos/src/eos/saftvrqmie.rs
.rs
3,474
98
use super::PyEquationOfState; #[cfg(feature = "dft")] use crate::dft::{PyFMTVersion, PyHelmholtzEnergyFunctional}; use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::parameter::PyParameters; use crate::residual::ResidualModel; use feos::saftvrqmie::{SaftVRQMie, SaftVRQMieOptions}; use feos_c...
Rust
3D
feos-org/feos
py-feos/src/eos/pcsaft.rs
.rs
5,346
142
use super::PyEquationOfState; #[cfg(feature = "dft")] use crate::dft::{PyFMTVersion, PyHelmholtzEnergyFunctional}; use crate::ideal_gas::IdealGasModel; use crate::parameter::{PyGcParameters, PyParameters}; use crate::residual::ResidualModel; #[cfg(feature = "dft")] use feos::pcsaft::PcSaftFunctional; use feos::pcsaft::...
Rust
3D
feos-org/feos
py-feos/src/eos/gc_pcsaft.rs
.rs
3,969
108
use super::PyEquationOfState; #[cfg(feature = "dft")] use crate::dft::{PyFMTVersion, PyHelmholtzEnergyFunctional}; use crate::{ideal_gas::IdealGasModel, parameter::PyGcParameters, residual::ResidualModel}; #[cfg(feature = "dft")] use feos::gc_pcsaft::GcPcSaftFunctional; use feos::gc_pcsaft::{GcPcSaft, GcPcSaftOptions};...
Rust
3D
feos-org/feos
py-feos/src/eos/saftvrmie.rs
.rs
1,822
50
use super::PyEquationOfState; use crate::{ideal_gas::IdealGasModel, parameter::PyParameters, residual::ResidualModel}; use feos::saftvrmie::{SaftVRMie, SaftVRMieOptions}; use feos_core::{EquationOfState, ResidualDyn}; use pyo3::prelude::*; use std::sync::Arc; #[pymethods] impl PyEquationOfState { /// SAFT-VR Mie e...
Rust
3D
feos-org/feos
py-feos/src/eos/uvtheory.rs
.rs
2,017
55
use super::PyEquationOfState; use crate::ideal_gas::IdealGasModel; use crate::parameter::PyParameters; use crate::residual::ResidualModel; use feos::uvtheory::{Perturbation, UVTheory, UVTheoryOptions}; use feos_core::{EquationOfState, ResidualDyn}; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use std::sync...
Rust
3D
feos-org/feos
py-feos/src/eos/multiparameter.rs
.rs
1,756
58
use super::PyEquationOfState; use crate::ideal_gas::IdealGasModel; use crate::parameter::PyParameters; use crate::residual::ResidualModel; use feos::multiparameter::MultiParameter; use feos_core::EquationOfState; use pyo3::prelude::*; use std::sync::Arc; #[pymethods] impl PyEquationOfState { /// Multiparameter Hel...
Rust
3D
feos-org/feos
py-feos/src/parameter/model_record.rs
.rs
6,230
206
//! Structs for parameter objects. //! //! - PyPureRecord //! - PyBinaryRecord use super::identifier::{PyIdentifier, PyIdentifierOption}; use crate::error::PyFeosError; use feos_core::parameter::*; use pyo3::types::PyDict; use pyo3::{exceptions::PyValueError, prelude::*}; use pythonize::{depythonize, pythonize}; use se...
Rust
3D
feos-org/feos
py-feos/src/parameter/mod.rs
.rs
26,185
723
use crate::error::PyFeosError; use feos_core::parameter::*; use indexmap::IndexSet; use pyo3::prelude::*; use pyo3::types::PyDict; use pythonize::depythonize; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::fmt::Write; mod chemical_record; mod fragmentation; mod identifier; mod model_record; mod s...
Rust
3D
feos-org/feos
py-feos/src/parameter/chemical_record.rs
.rs
3,689
121
use super::fragmentation::{fragment_molecule, PySmartsRecord}; use super::identifier::{PyIdentifier, PyIdentifierOption}; use crate::error::PyFeosError; use feos_core::parameter::{ChemicalRecord, Identifier}; use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use serde::{Deserialize, Serialize}; /// Information...
Rust
3D
feos-org/feos
py-feos/src/parameter/fragmentation.rs
.rs
5,981
184
use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::BufReader; use crate::error::PyFeosError; /// SMARTS code, required to fragmentize molecules into segments. #[derive(Clone, Serialize, Deserialize)] ...
Rust
3D
feos-org/feos
py-feos/src/parameter/identifier.rs
.rs
2,574
104
use feos_core::parameter::{Identifier, IdentifierOption}; use pyo3::prelude::*; use serde::{Deserialize, Serialize}; /// Identifier to match on while reading parameters from files. #[pyclass(name = "IdentifierOption", eq, eq_int)] #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)] pub enum PyIdentifierOp...
Rust
3D
feos-org/feos
py-feos/src/parameter/segment.rs
.rs
5,591
186
use crate::error::PyFeosError; use feos_core::parameter::*; use pyo3::prelude::*; use pyo3::types::PyDict; use pythonize::{depythonize, pythonize}; use serde::{Deserialize, Serialize}; use serde_json::Value; /// Parameters describing individual segments. #[derive(Serialize, Deserialize, Clone)] #[serde(from = "Segment...
Rust
3D
feos-org/feos
py-feos/src/dft/mod.rs
.rs
4,785
138
use crate::eos::{parse_molefracs, PyEquationOfState}; use crate::ideal_gas::IdealGasModel; use crate::residual::ResidualModel; use feos::hard_sphere::{FMTFunctional, FMTVersion}; use feos_core::{EquationOfState, ResidualDyn}; use feos_dft::Geometry; use numpy::PyReadonlyArray1; use pyo3::prelude::*; use pyo3::pyclass; ...
Rust
3D
feos-org/feos
py-feos/src/dft/solver.rs
.rs
5,027
184
use crate::PyVerbosity; use feos_dft::{DFTSolver, DFTSolverLog}; use ndarray::Array1; use numpy::{PyArray1, ToPyArray}; use pyo3::prelude::*; use quantity::Time; /// Settings for the DFT solver. /// /// Parameters /// ---------- /// verbosity: Verbosity, optional /// The verbosity level of the solver. /// Defa...
Rust
3D
feos-org/feos
py-feos/src/dft/solvation.rs
.rs
4,416
143
use super::profile::{impl_1d_profile, impl_3d_profile, impl_profile}; use super::{PyDFTSolver, PyDFTSolverLog}; use crate::residual::ResidualModel; use crate::state::{PyContributions, PyState}; use crate::{error::PyFeosError, ideal_gas::IdealGasModel}; use feos_core::{EquationOfState, ReferenceSystem}; use feos_dft::so...
Rust
3D
feos-org/feos
py-feos/src/dft/profile.rs
.rs
9,507
274
macro_rules! impl_profile { ($struct:ident, $arr:ident, $arr2:ident, $si_arr:ident, $si_arr2:ident, $py_arr2:ident, [$([$ind:expr, $ax:ident]),+]$(, $si_arr3:ident)?) => { #[pymethods] impl $struct { /// Calculate the residual for the given profile. /// /// Para...
Rust
3D
feos-org/feos
py-feos/src/dft/interface/mod.rs
.rs
5,392
183
use super::profile::{impl_1d_profile, impl_profile}; use super::{PyDFTSolver, PyDFTSolverLog}; use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::phase_equilibria::PyPhaseEquilibrium; use crate::residual::ResidualModel; use crate::state::{PyContributions, PyState}; use feos_core::{EquationOf...
Rust
3D
feos-org/feos
py-feos/src/dft/interface/surface_tension_diagram.rs
.rs
3,660
121
use super::PyPlanarInterface; use crate::dft::PyDFTSolver; use crate::phase_equilibria::PyPhaseEquilibrium; use crate::state::PyStateVec; use crate::{ideal_gas::IdealGasModel, residual::ResidualModel}; use feos_core::EquationOfState; use feos_dft::interface::SurfaceTensionDiagram; use ndarray::*; use numpy::*; use pyo3...
Rust
3D
feos-org/feos
py-feos/src/dft/adsorption/mod.rs
.rs
11,147
274
use super::PyDFTSolver; use crate::eos::{parse_molefracs, PyEquationOfState}; use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::residual::ResidualModel; use crate::PyVerbosity; use feos_core::EquationOfState; use feos_dft::adsorption::{Adsorption, Adsorption1D, Adsorption3D}; use nalgebra::...
Rust
3D
feos-org/feos
py-feos/src/dft/adsorption/external_potential.rs
.rs
8,981
255
use feos_dft::adsorption::ExternalPotential; use ndarray::Array2; use numpy::prelude::*; use numpy::PyArray1; use pyo3::prelude::*; use quantity::Length; /// A collection of external potentials. #[pyclass(name = "ExternalPotential")] #[derive(Clone)] pub struct PyExternalPotential(pub ExternalPotential); #[pymethods]...
Rust
3D
feos-org/feos
py-feos/src/dft/adsorption/pore.rs
.rs
10,755
351
use super::PyExternalPotential; use crate::dft::profile::*; use crate::dft::{PyDFTSolver, PyDFTSolverLog, PyGeometry}; use crate::error::PyFeosError; use crate::ideal_gas::IdealGasModel; use crate::residual::ResidualModel; use crate::state::{PyContributions, PyState}; use feos_core::{EquationOfState, ReferenceSystem}; ...
Rust
3D
feos-org/feos
crates/feos-derive/src/subset.rs
.rs
1,662
60
use quote::quote; use syn::DeriveInput; pub(crate) fn expand_subset(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream> { let variants = match input.data { syn::Data::Enum(syn::DataEnum { ref variants, .. }) => variants, _ => panic!("this derive macro only works on enums"), }; let...
Rust
3D
feos-org/feos
crates/feos-derive/src/lib.rs
.rs
3,533
103
//! This crate provides derive macros used for the EosVariant and //! FunctionalVariant enums in FeOs. The macros implement //! the boilerplate for the EquationOfState and HelmholtzEnergyFunctional traits. #![warn(clippy::all)] use dft::expand_helmholtz_energy_functional; use functional_contribution::expand_functional_...
Rust
3D
feos-org/feos
crates/feos-derive/src/functional_contribution.rs
.rs
4,031
127
use quote::quote; use syn::{DeriveInput, Ident}; pub(crate) fn expand_functional_contribution( input: DeriveInput, ) -> syn::Result<proc_macro2::TokenStream> { let ident = input.ident; let variants = match input.data { syn::Data::Enum(syn::DataEnum { ref variants, .. }) => variants, _ => pa...
Rust
3D
feos-org/feos
crates/feos-derive/src/ideal_gas.rs
.rs
1,660
59
use quote::quote; use syn::DeriveInput; pub(crate) fn expand_ideal_gas(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream> { let variants = match input.data { syn::Data::Enum(syn::DataEnum { ref variants, .. }) => variants, _ => panic!("this derive macro only works on enums"), }; ...
Rust
3D
feos-org/feos
crates/feos-derive/src/dft.rs
.rs
5,269
150
use crate::{implement, OPT_IMPLS}; use quote::quote; use syn::DeriveInput; pub(crate) fn expand_helmholtz_energy_functional( input: DeriveInput, ) -> syn::Result<proc_macro2::TokenStream> { let syn::Data::Enum(syn::DataEnum { ref variants, .. }) = input.data else { panic!("this derive macro only works ...
Rust
3D
feos-org/feos
crates/feos-derive/src/residual.rs
.rs
10,319
298
use super::{implement, OPT_IMPLS}; use quote::quote; use syn::DeriveInput; pub(crate) fn expand_residual(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream> { let variants = match input.data { syn::Data::Enum(syn::DataEnum { ref variants, .. }) => variants, _ => panic!("this derive macro o...
Rust
3D
feos-org/feos
crates/feos-core/CHANGELOG.md
.md
22,774
276
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). > [!IMPORTANT] > This file contains changes up to `feos-core` v0.8...
Markdown
3D
feos-org/feos
crates/feos-core/src/lib.rs
.rs
14,824
491
#![warn(clippy::all)] #![allow(clippy::reversed_empty_ranges)] #![warn(clippy::allow_attributes)] use quantity::{Quantity, SIUnit}; use std::ops::{Div, Mul}; /// Print messages with level `Verbosity::Iter` or higher. #[macro_export] macro_rules! log_iter { ($verbosity:expr, $($arg:tt)*) => { if $verbosity ...
Rust
3D
feos-org/feos
crates/feos-core/src/cubic.rs
.rs
7,266
222
//! Implementation of the Peng-Robinson equation of state. //! //! This module acts as a reference on how a simple equation //! of state - with a single contribution to the Helmholtz energy - can be implemented. //! The implementation closely follows the form of the equations given in //! [this wikipedia article](https...
Rust
3D
feos-org/feos
crates/feos-core/src/errors.rs
.rs
2,234
69
use num_dual::linalg::LinAlgError; use std::io; use thiserror::Error; /// Error type for improperly defined states and convergence problems. #[derive(Error, Debug)] pub enum FeosError { // generic error with custom message #[error("{0}")] Error(String), // errors related to algorithms #[error("`{0...
Rust
3D
feos-org/feos
crates/feos-core/src/density_iteration.rs
.rs
9,571
277
use crate::DensityInitialization::{self, InitialDensity, Liquid, Vapor}; use crate::errors::{FeosError, FeosResult}; use crate::{ReferenceSystem, Residual}; use nalgebra::allocator::Allocator; use nalgebra::{DefaultAllocator, Dim, OVector}; use num_dual::{Dual, DualNum, first_derivative}; use quantity::{Density, Pressu...
Rust
3D
feos-org/feos
crates/feos-core/src/ad/mod.rs
.rs
12,091
338
use crate::DensityInitialization::Liquid; use crate::density_iteration::density_iteration; use crate::{FeosResult, PhaseEquilibrium, ReferenceSystem, Residual}; use nalgebra::{Const, SVector, U1, U2}; #[cfg(feature = "rayon")] use ndarray::{Array1, Array2, ArrayView2, Zip}; use num_dual::{Derivative, DualSVec, DualStru...
Rust
3D
feos-org/feos
crates/feos-core/src/state/mod.rs
.rs
30,345
850
//! Description of a thermodynamic state. //! //! A thermodynamic state in SAFT is defined by //! * a temperature //! * an array of mole numbers //! * the volume //! //! Internally, all properties are computed using such states as input. use crate::density_iteration::density_iteration; use crate::equation_of_state::Res...
Rust
3D
feos-org/feos
crates/feos-core/src/state/statevec.rs
.rs
3,494
111
#[cfg(feature = "ndarray")] use super::Contributions; use super::State; #[cfg(feature = "ndarray")] use crate::equation_of_state::{Molarweight, Residual, Total}; #[cfg(feature = "ndarray")] use ndarray::{Array1, Array2}; #[cfg(feature = "ndarray")] use quantity::{ Density, MassDensity, MolarEnergy, MolarEntropy, M...
Rust
3D
feos-org/feos
crates/feos-core/src/state/cache.rs
.rs
1,606
48
use nalgebra::allocator::Allocator; use nalgebra::{DefaultAllocator, Dim, OVector, Scalar}; use quantity::*; use std::ops::Sub; use std::sync::OnceLock; type Diff<T1, T2> = <T1 as Sub<T2>>::Output; #[derive(Clone, Debug)] #[expect(clippy::type_complexity)] pub struct Cache<D: Scalar, N: Dim> where DefaultAllocato...
Rust
3D
feos-org/feos
crates/feos-core/src/state/residual_properties.rs
.rs
29,542
712
use super::{Contributions, State}; use crate::equation_of_state::{EntropyScaling, Molarweight, Residual, Subset}; use crate::{FeosResult, PhaseEquilibrium, ReferenceSystem}; use nalgebra::allocator::Allocator; use nalgebra::{DMatrix, DVector, DefaultAllocator, OMatrix, OVector, dvector}; use num_dual::{Dual, DualNum, G...
Rust
3D
feos-org/feos
crates/feos-core/src/state/properties.rs
.rs
13,018
323
use super::{Contributions, State}; use crate::equation_of_state::{Molarweight, Total}; use crate::{ReferenceSystem, Residual}; use nalgebra::allocator::Allocator; use nalgebra::{DefaultAllocator, OVector}; use num_dual::{Dual, DualNum, Gradients, partial, partial2}; use quantity::*; use std::ops::{Div, Neg}; type InvP...
Rust
3D
feos-org/feos
crates/feos-core/src/state/critical_point.rs
.rs
20,754
615
use super::{DensityInitialization, State}; use crate::equation_of_state::Residual; use crate::errors::{FeosError, FeosResult}; use crate::{ReferenceSystem, SolverOptions, Subset, TemperatureOrPressure, Verbosity}; use nalgebra::allocator::Allocator; use nalgebra::{DVector, DefaultAllocator, OMatrix, OVector, SVector, U...
Rust
3D
feos-org/feos
crates/feos-core/src/state/builder.rs
.rs
8,333
252
use super::{DensityInitialization, State}; use crate::Total; use crate::equation_of_state::Residual; use crate::errors::FeosResult; use nalgebra::DVector; use quantity::*; /// A simple tool to construct [State]s with arbitrary input parameters. /// /// # Examples /// ``` /// # use feos_core::{FeosResult, StateBuilder}...
Rust
3D
feos-org/feos
crates/feos-core/src/equation_of_state/mod.rs
.rs
6,377
211
use crate::{ReferenceSystem, StateHD}; use nalgebra::{ Const, DVector, DefaultAllocator, Dim, Dyn, OVector, SVector, U1, allocator::Allocator, }; use num_dual::DualNum; use quantity::{Energy, MolarEnergy, Moles, Temperature, Volume}; use std::ops::Deref; mod residual; pub use residual::{EntropyScaling, Molarweight...
Rust
3D
feos-org/feos
crates/feos-core/src/equation_of_state/residual.rs
.rs
17,915
512
use crate::{FeosError, FeosResult, ReferenceSystem, state::StateHD}; use nalgebra::{DVector, DefaultAllocator, Dim, Dyn, OMatrix, OVector, U1, allocator::Allocator}; use num_dual::{DualNum, Gradients, partial, partial2, second_derivative, third_derivative}; use quantity::ad::first_derivative; use quantity::*; use std::...
Rust
3D
feos-org/feos
crates/feos-core/src/parameter/model_record.rs
.rs
10,964
345
use super::{AssociationRecord, BinaryAssociationRecord, Identifier, IdentifierOption}; use crate::FeosResult; use crate::errors::FeosError; use indexmap::IndexSet; use num_traits::Zero; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; use std::fmt; use std:...
Rust
3D
feos-org/feos
crates/feos-core/src/parameter/mod.rs
.rs
33,221
950
//! Structures and traits that can be used to build model parameters for equations of state. use crate::errors::*; use indexmap::{IndexMap, IndexSet}; use itertools::Itertools; use nalgebra::{DMatrix, DVector, Scalar}; use quantity::{GRAM, MOL, MolarWeight}; use serde::Serialize; use serde::de::DeserializeOwned; use st...
Rust
3D
feos-org/feos
crates/feos-core/src/parameter/association.rs
.rs
11,068
321
use super::{BinaryParameters, BinaryRecord, GroupCount, PureParameters}; use crate::{FeosResult, parameter::PureRecord}; use nalgebra::DVector; use num_traits::Zero; use serde::{Deserialize, Serialize}; use std::collections::HashMap; /// Pure component association parameters. #[derive(Serialize, Deserialize, Clone, De...
Rust
3D
feos-org/feos
crates/feos-core/src/parameter/chemical_record.rs
.rs
5,911
190
use super::{Identifier, IdentifierOption}; use crate::{FeosError, FeosResult}; use indexmap::IndexMap; use itertools::Itertools; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::BufReader; use std::ops::Deref; use std::path::Path; // Auxiliary structure use...
Rust
3D
feos-org/feos
crates/feos-core/src/parameter/identifier.rs
.rs
4,814
164
use serde::{Deserialize, Serialize}; use std::fmt; use std::hash::{Hash, Hasher}; /// Possible variants to identify a substance. #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)] pub enum IdentifierOption { Cas, Name, IupacName, Smiles, Inchi, Formula, } impl fmt::Display for Id...
Rust
3D
feos-org/feos
crates/feos-core/src/phase_equilibria/phase_envelope.rs
.rs
5,518
158
use super::{PhaseDiagram, PhaseEquilibrium}; use crate::SolverOptions; use crate::equation_of_state::Residual; use crate::errors::FeosResult; use crate::state::{Contributions, State}; use nalgebra::DVector; use quantity::{Pressure, Temperature}; impl<E: Residual> PhaseDiagram<E, 2> { /// Calculate the bubble point...
Rust