Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fb9d4e7
Documentation Restructure
pavithraes May 13, 2024
e72e620
:broom: Fix links to old docs pages
pavithraes Apr 10, 2024
faee778
Merge pull request #142 from Point72/pavithraes/docs-restructure
Carreau May 13, 2024
118a2fb
Fix to_json serialization for floats
arhamchopra Apr 10, 2024
c51a86b
Merge pull request #189 from Point72/pavithraes/fix-links
robambalu Apr 10, 2024
8adb1a7
Upgrade baseline in vcpkg.json
arhamchopra Apr 11, 2024
f6b0963
Parse None natively in to_json method
arhamchopra Apr 10, 2024
cc60b87
Merge pull request #191 from Point72/ac/fix_to_json_parsing_floats
arhamchopra Apr 10, 2024
eaec4a0
Update baseline to stable version
arhamchopra Apr 11, 2024
68dda2f
Merge pull request #192 from Point72/ac/parse_none_to_json
arhamchopra Apr 11, 2024
f11b8fc
PushPullInputAdapter - fix to previous patch that fixed out of order …
robambalu Apr 17, 2024
3ca95b3
Merge pull request #194 from Point72/ac/upgrade_vcpkg_43d81795a
arhamchopra Apr 16, 2024
ef1a239
Merge pull request #195 from Point72/bugfix/push_pull_ooo_patch
robambalu Apr 17, 2024
86c4e6d
Revert "Upgrade baseline in vcpkg.json"
arhamchopra Apr 17, 2024
e70e4d7
Merge pull request #174 from Point72/tkp/slacktut
timkpaine Apr 17, 2024
df3bb2d
Merge pull request #196 from Point72/revert-194-ac/upgrade_vcpkg_43d8…
arhamchopra Apr 17, 2024
abcd307
Move websocket example after merge
timkpaine Apr 18, 2024
4ea4799
Maintain the type of a list-derived object when converting a struct i…
AdamGlustein Apr 17, 2024
ba90a02
Merge pull request #200 from Point72/tkp/docs
timkpaine Apr 19, 2024
5103026
Re-apply lost updates in dev guides (#202)
pavithraes Apr 23, 2024
64559cb
Include AS statement in SQL build query regardless of sqlalchemy vers…
AdamGlustein Apr 29, 2024
2abdf59
Update vcpkg baseline (#209)
robambalu May 3, 2024
e2a4f2b
Fix interrupt handling issues in csp: ensure first node is stopped an…
AdamGlustein May 1, 2024
89eda4c
fix @217 | add tests
wrieg123 May 6, 2024
da9a84f
minor bugfix to unroll cppimpl. Missing cast from vector value to El…
robambalu May 6, 2024
efe0fd6
Add format check to lint step
timkpaine May 3, 2024
7a25f45
Merge pull request #219 from Point72/wrr/fix_ws_json_mapper
wrieg123 May 6, 2024
da4d5e3
fix format changes that will now result in lint failures
timkpaine May 3, 2024
7441fb5
Add build-debug option to Makefile so we dont forget the proper incan…
robambalu May 6, 2024
d9ac41d
Pin linters to narrow range to avoid noise
timkpaine May 7, 2024
086c9d5
Add placeholder block to build action for service tests (in another PR)
timkpaine May 3, 2024
8a0d881
Remove all caching code from CSP (#213)
AdamGlustein May 7, 2024
471e142
Run autofixers with pinned up packages
timkpaine May 7, 2024
78e7aca
Merge pull request #211 from Point72/tkp/checklint
timkpaine May 7, 2024
12cceeb
Merge pull request #223 from Point72/tkp/lint
timkpaine May 8, 2024
7b3c3a7
Python 3.12 build support (#221)
robambalu May 8, 2024
68927fe
Update to arrow / pyarrow 16 (#210)
robambalu May 9, 2024
d6479c5
Upgrade CSP to C++20; build websocket against C++17; rename .hi files…
AdamGlustein May 9, 2024
b99ee3c
Rewritten branch Empty commit.
Carreau May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/setup-caches/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inputs:
- 'cp39'
- 'cp310'
- 'cp311'
- 'cp312'
default: 'cp39'

runs:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inputs:
- 'cp39'
- 'cp310'
- 'cp311'
- 'cp312'
default: 'cp39'

runs:
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inputs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
default: '3.9'

runs:
Expand All @@ -33,4 +34,4 @@ runs:

- name: Install cibuildwheel and twine
shell: bash
run: pip install cibuildwheel==2.11.2 twine
run: pip install cibuildwheel==2.16.5 twine
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,13 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
cibuildwheel:
- "cp38"
- "cp39"
- "cp310"
- "cp311"
- "cp312"
is-full-run:
- ${{ needs.initialize.outputs.FULL_RUN == 'true' }}
exclude:
Expand All @@ -198,24 +200,41 @@ jobs:
cibuildwheel: "cp310"
- python-version: "3.8"
cibuildwheel: "cp311"
- python-version: "3.8"
cibuildwheel: "cp312"
- python-version: "3.9"
cibuildwheel: "cp38"
- python-version: "3.9"
cibuildwheel: "cp310"
- python-version: "3.9"
cibuildwheel: "cp311"
- python-version: "3.9"
cibuildwheel: "cp312"
- python-version: "3.10"
cibuildwheel: "cp38"
- python-version: "3.10"
cibuildwheel: "cp39"
- python-version: "3.10"
cibuildwheel: "cp311"
- python-version: "3.10"
cibuildwheel: "cp312"
- python-version: "3.11"
cibuildwheel: "cp38"
- python-version: "3.11"
cibuildwheel: "cp39"
- python-version: "3.11"
cibuildwheel: "cp310"
- python-version: "3.11"
cibuildwheel: "cp312"
- python-version: "3.12"
cibuildwheel: "cp38"
- python-version: "3.12"
cibuildwheel: "cp39"
- python-version: "3.12"
cibuildwheel: "cp310"
- python-version: "3.12"
cibuildwheel: "cp311"


##############################################
# Things to exclude if not a full matrix run #
Expand Down Expand Up @@ -402,6 +421,7 @@ jobs:
- 3.9
- "3.10"
- 3.11
- 3.12
is-full-run:
- ${{ needs.initialize.outputs.FULL_RUN == 'true' }}
exclude:
Expand Down Expand Up @@ -625,6 +645,20 @@ jobs:
run: make test
if: ${{ contains( 'numpy', matrix.package )}}

###########################
#~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~|#############|~~~~#
#~~~~~~|#|~~~~~~~/##/~~~~~#
#~~~~~~|#|~~~~~/##/~~~~~~~#
#~~~~~~~~~~~~/##/~~~~~~~~~#
#~~~~~~~~~~/##/~~~~~~~~~~~#
#~~~~~~~~/##/~~~~~~~~~~~~~#
#~~~~~~/##/~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~#
# Test Service Adapters #
#~~~~~~~~~~~~~~~~~~~~~~~~~#
# Coming soon!

#############################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~|#############|~~~~~~#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Set up Caches
uses: ./.github/actions/setup-caches
with:
cibuildwheel: 'cp311'
cibuildwheel: 'cp312'

- name: Python Lint Steps
run: make lint
Expand Down
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#########################
cmake_minimum_required(VERSION 3.20.0)
project(csp VERSION "0.0.3")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)

###################################################################################################################################################
# CMake Dependencies #
Expand Down Expand Up @@ -98,7 +98,7 @@ if(CSP_USE_CCACHE)
endif()

if(NOT DEFINED CSP_PYTHON_VERSION)
set(CSP_PYTHON_VERSION 3.11)
set(CSP_PYTHON_VERSION 3.12)
endif()

# Path to python folder for autogen
Expand Down Expand Up @@ -153,9 +153,6 @@ endif()
###################################################################################################################################################
# Flags #
#########
# Compiler version flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

# Optimization Flags
if(WIN32)
if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug)
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif
#########
# BUILD #
#########
.PHONY: requirements develop build build-conda install
.PHONY: requirements develop build build-debug build-conda install

requirements: ## install python dev and runtime dependencies
python -m pip install toml
Expand All @@ -24,6 +24,9 @@ develop: requirements ## install dependencies and build library
build: ## build the library
python setup.py build build_ext --inplace -- -- -j$(NPROC)

build-debug: ## build the library ( DEBUG ) - May need a make clean when switching from regular build to build-debug and vice versa
SKBUILD_CONFIGURE_OPTIONS="" DEBUG=1 python setup.py build build_ext --inplace -- -- -j$(NPROC)

build-conda: ## build the library in Conda
CSP_USE_VCPKG=0 python setup.py build build_ext --inplace -- -- -j$(NPROC)

Expand All @@ -38,14 +41,15 @@ install: ## install library
lint-py:
python -m isort --check csp/ examples/ setup.py
python -m ruff check csp/ examples/ setup.py
python -m ruff format --check csp/ examples/ setup.py

lint-cpp:
# clang-format --dry-run -Werror -i -style=file `find ./cpp/ -name "*.*pp"`
echo "C++ linting disabled for now"

lint-docs:
python -m mdformat --check docs/wiki/ README.md examples/README.md
python -m codespell_lib docs/wiki/ README.md examples/README.md
python -m mdformat --check docs/wiki/ README.md examples/
python -m codespell_lib docs/wiki/ README.md examples/ --skip "*.cpp,*.h"

# lint: lint-py lint-cpp ## run lints
lint: lint-py lint-docs ## run lints
Expand All @@ -62,8 +66,8 @@ fix-cpp:
echo "C++ autoformatting disabled for now"

fix-docs:
python -m mdformat docs/wiki/ README.md examples/README.md
python -m codespell_lib --write docs/wiki/ README.md examples/README.md
python -m mdformat docs/wiki/ README.md examples/
python -m codespell_lib --write docs/wiki/ README.md examples/ --skip "*.cpp,*.h"

fix: fix-py fix-cpp fix-docs ## run autofixers

Expand Down Expand Up @@ -191,9 +195,6 @@ dependencies-debian: ## install dependencies for linux
dependencies-fedora: ## install dependencies for linux
yum install -y automake bison ccache cmake curl flex perl-IPC-Cmd tar unzip zip

dependencies-alma: ## install dependencies for linux
dnf install -y automake bison ccache cmake curl flex perl-IPC-Cmd tar unzip zip

dependencies-vcpkg: ## install dependnecies via vcpkg
cd vcpkg && ./bootstrap-vcpkg.sh && ./vcpkg install

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ See [our wiki!](https://github.com/Point72/csp/wiki)

## Development

Check out the [Developer Documentation](https://github.com/Point72/csp/wiki/99.-Developer)
Check out the [contribution guide](https://github.com/Point72/csp/wiki/Contribute) and [local development instructions](https://github.com/Point72/csp/wiki/Local-Development-Setup).

## Authors

Expand Down
23 changes: 14 additions & 9 deletions conda/dev-environment-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,50 @@ channels:
dependencies:
- bison
- brotli
- build
- bump2version>=1
- cmake
- codespell
- codespell>=2.2.6,<2.3
- compilers
- cyrus-sasl
- exprtk
- flex
- graphviz
- python-graphviz
- gtest
- httpx
- isort
- libarrow=15
- httpx>=0.20,<1
- isort>=5,<6
- libarrow=16
- librdkafka
- libboost-headers
- lz4-c
- mamba
- mdformat
- mdformat>=0.7.17,<0.8
- ninja
- numpy
- pillow
- psutil
- pyarrow=15
- pyarrow=16
- pandas
- pillow
- polars
- psutil
- pytz
- pytest
- pytest-asyncio
- pytest-cov
- pytest-sugar
- pytest-asyncio
- python<3.12
- python<3.13
- python-rapidjson
- rapidjson
- requests
- ruamel.yaml
- ruff
- ruff>=0.3,<0.4
- scikit-build
- slack-sdk
- sqlalchemy
- tar
- threadpoolctl
- tornado
- twine
- unzip
Expand Down
3 changes: 3 additions & 0 deletions cpp/csp/adapters/websocket/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
csp_autogen( csp.adapters.websocket_types websocket_types WEBSOCKET_HEADER WEBSOCKET_SOURCE )

# Need to build websocket adapter under cpp17 standard due to websocketpp incompatibility issues
set(CMAKE_CXX_STANDARD 17)

set(WS_CLIENT_HEADER_FILES
ClientAdapterManager.h
ClientInputAdapter.h
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/adapters/websocket/ClientInputAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void ClientInputAdapter::processMessage( std::string payload, PushBatch* batch )

if( type() -> type() == CspType::Type::STRUCT )
{
auto tick = m_converter -> asStruct( &payload, payload.length() );
auto tick = m_converter -> asStruct( (void*)payload.data(), payload.length() );
pushTick( std::move(tick), batch );
} else if ( type() -> type() == CspType::Type::STRING )
{
Expand Down
2 changes: 0 additions & 2 deletions cpp/csp/adapters/websocket/ClientInputAdapter.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_INPUTADAPTER_H
#define _IN_CSP_ADAPTERS_WEBSOCKETS_CLIENT_INPUTADAPTER_H

#include <websocketpp/config/core_client.hpp>
#include <websocketpp/client.hpp>
#include <csp/engine/Dictionary.h>
#include <csp/adapters/utils/MessageStructConverter.h>
#include <csp/engine/PushInputAdapter.h>
Expand Down
1 change: 0 additions & 1 deletion cpp/csp/adapters/websocket/ClientOutputAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <csp/engine/Dictionary.h>
#include <csp/engine/OutputAdapter.h>
#include <csp/adapters/utils/MessageWriter.h>
#include <websocketpp/client.hpp>

namespace csp::adapters::websocket
{
Expand Down
4 changes: 2 additions & 2 deletions cpp/csp/cppnodes/baselibimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ DECLARE_CPPNODE( unroll )
{
size_t idx = 0;
if( !s_pending )
CSP_OUTPUT( v[idx++] );
CSP_OUTPUT( static_cast<ElemT>( v[idx++] ) );

s_pending += sz - idx;
for( ; idx < sz; ++idx )
csp.schedule_alarm( alarm, TimeDelta::ZERO(), v[idx] );
csp.schedule_alarm( alarm, TimeDelta::ZERO(), static_cast<ElemT>( v[idx] ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/PushPullInputAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ PushPullInputAdapter::PullDataEvent * PushPullInputAdapter::nextPullEvent()
auto * event = m_poppedPullEvents.front();
m_poppedPullEvents.pop();

if( m_adjustOutOfOrderTime )
if( m_adjustOutOfOrderTime && event )
event -> time = std::max( event -> time, rootEngine() -> now() );

return event;
Expand Down
23 changes: 18 additions & 5 deletions cpp/csp/engine/RootEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@
namespace csp
{

static volatile bool g_SIGNALED = false;
static volatile int g_SIGNAL_COUNT = 0;
/*
The signal count variable is maintained to ensure that multiple engine threads shutdown properly.

An interrupt should cause all running engines to stop, but should not affect future runs in the same process.
Thus, each root engine keeps track of the signal count when its created. When an interrupt occurs, one engine thread
handles the interrupt by incrementing the count. Then, all other root engines detect the signal by comparing their
initial count to the current count.

Future runs after the interrupt remain unaffected since they are initialized with the updated signal count, and will
only consider themselves "interupted" if another signal is received during their execution.
*/

static struct sigaction g_prevSIGTERMaction;

static void handle_SIGTERM( int signum )
{
g_SIGNALED = true;
g_SIGNAL_COUNT++;
if( g_prevSIGTERMaction.sa_handler )
(*g_prevSIGTERMaction.sa_handler)( signum );
}
Expand Down Expand Up @@ -58,6 +70,7 @@ RootEngine::RootEngine( const Dictionary & settings ) : Engine( m_cycleStepTable
m_cycleCount( 0 ),
m_settings( settings ),
m_inRealtime( false ),
m_initSignalCount( g_SIGNAL_COUNT ),
m_pushEventQueue( m_settings.queueWaitTime > TimeDelta::ZERO() )
{
if( settings.get<bool>( "profile", false ) )
Expand All @@ -78,7 +91,7 @@ RootEngine::~RootEngine()

bool RootEngine::interrupted() const
{
return g_SIGNALED;
return g_SIGNAL_COUNT != m_initSignalCount;
}

void RootEngine::preRun( DateTime start, DateTime end )
Expand Down Expand Up @@ -131,7 +144,7 @@ void RootEngine::processEndCycle()
void RootEngine::runSim( DateTime end )
{
m_inRealtime = false;
while( m_scheduler.hasEvents() && m_state == State::RUNNING && !g_SIGNALED )
while( m_scheduler.hasEvents() && m_state == State::RUNNING && !interrupted() )
{
m_now = m_scheduler.nextTime();
if( m_now > end )
Expand Down Expand Up @@ -161,7 +174,7 @@ void RootEngine::runRealtime( DateTime end )

m_inRealtime = true;
bool haveEvents = false;
while( m_state == State::RUNNING && !g_SIGNALED )
while( m_state == State::RUNNING && !interrupted() )
{
TimeDelta waitTime;
if( !m_pendingPushEvents.hasEvents() )
Expand Down
Loading