generated from CIERA-Northwestern/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
095f0d8
commit 6668ccd
Showing
10 changed files
with
25,070 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) Scott Coughlin (2019) | ||
# | ||
# This file is part of python_tutorial. | ||
# | ||
# python_tutorial is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# python_tutorial is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with python_tutorial. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Unit test for python_tutorial.YOURMODULE classes | ||
""" | ||
|
||
from python_tutorial.rectangle import PyRectangle | ||
|
||
class TestPyRectangle(object): | ||
def test_get_area(self): | ||
assert 4 == PyRectangle(0,0,2,2).get_area() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) Scott Coughlin (2019) | ||
# | ||
# This file is part of python_tutorial. | ||
# | ||
# python_tutorial is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# python_tutorial is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with python_tutorial. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Unit test for python_tutorial.YOURMODULE classes | ||
""" | ||
|
||
from python_tutorial.rectangle import PyRectangle | ||
|
||
class TestPyRectangle(object): | ||
def test_get_area(self): | ||
assert 4 == PyRectangle(0,0,2,2).get_area() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) Scott Coughlin (2019) | ||
# | ||
# This file is part of python_tutorial | ||
# | ||
# python_tutorial is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# python_tutorial is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with python_tutorial. If not, see <http://www.gnu.org/licenses/> | ||
|
||
from .timeseries import PyTimeSeries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <iostream> | ||
#include "TimeSeries.h" | ||
|
||
namespace timeseries { | ||
|
||
// Default constructor | ||
TimeSeries::TimeSeries () {} | ||
|
||
// Overloaded constructor | ||
TimeSeries::TimeSeries (double* series, int size, double* xindex, double* dydx) { | ||
this->series = series; | ||
this->xindex = xindex; | ||
this->dydx = dydx; | ||
this->size = size; | ||
this->x0 = series[0]; | ||
} | ||
|
||
// Destructor | ||
TimeSeries::~TimeSeries () {} | ||
|
||
double TimeSeries::getDT () { | ||
return (this->xindex[1] - this->xindex[0]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef TIMESERIES_H | ||
#define TIMESERIES_H | ||
|
||
namespace timeseries { | ||
class TimeSeries { | ||
public: | ||
double x0; | ||
int size; | ||
double* series; | ||
double* xindex; | ||
double* dydx; | ||
TimeSeries(); | ||
TimeSeries(double* series, int size, double* xindex, double* dydx); | ||
~TimeSeries(); | ||
double getDT(); | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# distutils: sources = python_tutorial/rectangle/src/TimeSeries.cpp | ||
|
||
cdef extern from "TimeSeries.h" namespace "timeseries": | ||
cdef cppclass TimeSeries: | ||
TimeSeries() except + | ||
TimeSeries(double [], int, double [], double []) except + | ||
double x0 | ||
double* series | ||
double* xindex | ||
double* dydx | ||
int size | ||
double getDT() |
Empty file.
Oops, something went wrong.