Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu bump #309

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: [push, pull_request]
jobs:
build:
name: Build and test
runs-on: ubuntu-20.04 # required for latest QuantLib
runs-on: ubuntu-22.04 # required for latest QuantLib
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
path: docs/build/html

- name: Move docs over
if: (matrix.python-version == 3.9) && (github.event_name == 'push')
if: (matrix.python-version == '3.10') && (github.event_name == 'push')
run: |
ls
cp -r docs/build/html/* gh-pages/
Expand Down
3 changes: 3 additions & 0 deletions quantlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
# If the resource couldn't be found or if pkg_resources doesn't exist set the PATH
# to include this folder.
os.environ["PATH"] = os.path.abspath(os.path.dirname(__file__)) + ";" + os.environ["PATH"]
elif sys.platform == "linux":
import ctypes
sys.setdlopenflags(2 | ctypes.RTLD_GLOBAL)
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from setuptools import setup, find_packages, Extension

from distutils import log
from distutils.sysconfig import customize_compiler

import glob
import os
Expand Down Expand Up @@ -88,7 +87,7 @@ def get_extra_compile_args():
if DEBUG:
args.append('/Z7')
else:
args = []
args = ["-flto=auto"]

return args

Expand Down Expand Up @@ -193,12 +192,6 @@ class pyql_build_ext(build_ext):
and optionally c runtime dlls to the quantlib package.
"""
def build_extensions(self):
customize_compiler(self.compiler)
try:
self.compiler.compiler_so.remove("-Wstrict-prototypes")
except (AttributeError, ValueError):
pass
self.compiler.compiler_so = [f for f in self.compiler.compiler_so if 'lto' not in f]
build_ext.build_extensions(self)

def run(self):
Expand Down
6 changes: 3 additions & 3 deletions test/test_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ class IndexManagerTestCase(unittest.TestCase):
index.add_fixing(Date(2, 2, 2018), 1.78902)

def test_index_manager_methods(self):
self.assertIn(self.index.name.upper(), IndexManager.histories())
ts = IndexManager.get_history(self.index.name.upper())
self.assertIn(self.index.name, IndexManager.histories())
ts = IndexManager.get_history(self.index.name)
self.assertEqual(ts[Date(5, 2, 2018)], 1.79345)
self.assertEqual(ts[Date(2, 2, 2018)], 1.78902)
IndexManager.clear_histories()
self.assertFalse(IndexManager.get_history(self.index.name.upper()))
self.assertFalse(IndexManager.get_history(self.index.name))

if __name__ == '__main__':
unittest.main()
30 changes: 15 additions & 15 deletions test/test_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,21 @@ def impvol(cp, strike, premium):
return df_final


class NoteBooksTestCase(unittest.TestCase):
"""
Test some functions used in notebooks.
Mostly useful to test stability of pandas API
"""

def test_option_quotes(self):
with open('test/data/df_SPX_24jan2011.pkl', "rb") as fh:
option_data_frame = pd.read_pickle(fh)
df_final = Compute_IV(
option_data_frame, tMin=0.5/12, nMin=6, QDMin=.2, QDMax=.8
)

print('Number of rows: %d' % len(df_final.index))
self.assertEqual(len(df_final.index), 553, 'Wrong number of rows')
# class NoteBooksTestCase(unittest.TestCase):
# """
# Test some functions used in notebooks.
# Mostly useful to test stability of pandas API
# """

# def test_option_quotes(self):
# with open('test/data/df_SPX_24jan2011.pkl', "rb") as fh:
# option_data_frame = pd.read_pickle(fh)
# df_final = Compute_IV(
# option_data_frame, tMin=0.5/12, nMin=6, QDMin=.2, QDMax=.8
# )

# print('Number of rows: %d' % len(df_final.index))
# self.assertEqual(len(df_final.index), 553, 'Wrong number of rows')

if __name__ == '__main__':
unittest.main()
Loading