Skip to content

Commit

Permalink
Fix CI (#162)
Browse files Browse the repository at this point in the history
* try to fix codestyle

* try to fix weird pyscf failure

* print clang-format version

* clang-format 14 formatting

* temporarily polembed only and verbose

* try again

* older numpy (pyscf failure)

* update catch2

* fix conda env test and add comment

* use newest possible single-header catch2, temp disable other tests

* back to normal?
  • Loading branch information
maxscheurer authored Jan 23, 2023
1 parent 62dcc76 commit 023ebea
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 26 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ jobs:
python -m pip install --user -r requirements.txt -v
#
- name: Run python tests with std allocator
run: python setup.py test -a '--cov=adcc'
run: |
python setup.py test -a '--cov=adcc'
- name: Run reduced python tests with libxm
run: python setup.py test -a '--allocator=libxm -k "TestFunctionality and h2o_sto3g"'
run: |
python setup.py test -a '--allocator=libxm -k "TestFunctionality and h2o_sto3g"'
- name: Run C++ tests
run: python setup.py cpptest -v
#
Expand Down Expand Up @@ -168,10 +170,11 @@ jobs:
- name: Install dependencies
run: |
pip install flake8
sudo apt-get install clang-format-9
sudo apt-get install clang-format
- run: flake8
- name: Checking C++ files with clang-format
working-directory: libadcc
run: |
clang-format --version
find . -type f \( -name '*.cc' -o -name '*.hh' \) -print0 | xargs -r0 clang-format -i
git diff --exit-code
2 changes: 1 addition & 1 deletion conda/environment_dev_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- libtensorlight =3.0.1=hc894906_1
- pybind11 >=2.6
# Run
- numpy >=1.14
- numpy >=1.14,<1.24 # problems with PE in pyscf for 1.24
- scipy >=1.2
- tqdm >=4.30
- h5py >=2.9
Expand Down
8 changes: 4 additions & 4 deletions libadcc/Tensor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class Tensor {
*/
Tensor(std::shared_ptr<const AdcMemory> adcmem_ptr, std::vector<AxisInfo> axes);

Tensor(Tensor&&) = default;
Tensor& operator=(Tensor&&) = default;
virtual ~Tensor() = default;
Tensor(const Tensor&) = default;
Tensor(Tensor&&) = default;
Tensor& operator=(Tensor&&) = default;
virtual ~Tensor() = default;
Tensor(const Tensor&) = default;
Tensor& operator=(const Tensor&) = default;

//@{
Expand Down
2 changes: 1 addition & 1 deletion libadcc/ThreadPool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ThreadPool {
size_t n_total() const { return m_n_total; }

// Avoid copying or copy-assinging
ThreadPool(const ThreadPool&) = delete;
ThreadPool(const ThreadPool&) = delete;
ThreadPool& operator=(const ThreadPool&) = delete;

~ThreadPool();
Expand Down
2 changes: 1 addition & 1 deletion libadcc/Timer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class RecordTime {
timer.start(task);
}
~RecordTime() { timer.stop(task); }
RecordTime(const RecordTime&) = delete;
RecordTime(const RecordTime&) = delete;
RecordTime& operator=(const RecordTime&) = delete;

Timer& timer; //!< Timer object, which is managed
Expand Down
10 changes: 5 additions & 5 deletions libadcc/tests/HFSolutionMock.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ struct HFSolutionMock : public HartreeFockSolution_i {
size_t exposed_n_bas = 7;
std::vector<size_t> exposed_occupation = {1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0};
std::vector<double> exposed_orben = {
-2.0233397420161026e+01, -1.2657145550718050e+00, -6.2926710042596645e-01,
-4.4166801612481776e-01, -3.8764506899048456e-01, 6.0283939648336604e-01,
7.6591832861501685e-01, -2.0233397420161026e+01, -1.2657145550718050e+00,
-6.2926710042596645e-01, -4.4166801612481776e-01, -3.8764506899048456e-01,
6.0283939648336604e-01, 7.6591832861501685e-01};
-2.0233397420161026e+01, -1.2657145550718050e+00, -6.2926710042596645e-01,
-4.4166801612481776e-01, -3.8764506899048456e-01, 6.0283939648336604e-01,
7.6591832861501685e-01, -2.0233397420161026e+01, -1.2657145550718050e+00,
-6.2926710042596645e-01, -4.4166801612481776e-01, -3.8764506899048456e-01,
6.0283939648336604e-01, 7.6591832861501685e-01};

size_t n_orbs_alpha() const override { return exposed_n_orbs_alpha; }
real_type conv_tol() const override { return 1e-10; }
Expand Down
16 changes: 8 additions & 8 deletions libadcc/tests/TensorTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ TEST_CASE("Test Tensor interface", "[tensor]") {
double vector2[] = {1.0, 0.0, 1.0, 0.0, 1.0};
double vector3[] = {0.0, 1.0, 0.0, 1.0, 0.0};
double matrix[] = {1.1, 1.2, 1.3, 1.4, 1.5, //
1.2, 2.2, 2.3, 2.4, 2.5, //
1.3, 2.3, 3.3, 3.4, 3.5, //
1.4, 2.4, 3.4, 4.4, 4.5, //
1.5, 2.5, 3.5, 4.5, 5.5};
1.2, 2.2, 2.3, 2.4, 2.5, //
1.3, 2.3, 3.3, 3.4, 3.5, //
1.4, 2.4, 3.4, 4.4, 4.5, //
1.5, 2.5, 3.5, 4.5, 5.5};
double batrix[] = {0.0, 1.2, 1.3, 1.4, 1.5, //
-1.2, 0.0, 2.3, 2.4, 2.5, //
-1.3, -2.3, 0.0, 3.4, 3.5, //
-1.4, -2.4, -3.4, 0.0, 4.5, //
-1.5, -2.5, -3.5, -4.5, 0.0};
-1.2, 0.0, 2.3, 2.4, 2.5, //
-1.3, -2.3, 0.0, 3.4, 3.5, //
-1.4, -2.4, -3.4, 0.0, 4.5, //
-1.5, -2.5, -3.5, -4.5, 0.0};

// And import it
auto v1_ptr = std::make_shared<libtensor::btensor<1>>(bis5);
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def compile_test_executable(self):
if not os.path.isfile(output_dir + "/catch2/catch.hpp"):
os.makedirs(output_dir + "/catch2", exist_ok=True)
base = "https://github.com/catchorg/Catch2/releases/download/"
request_urllib(base + "v2.7.0/catch.hpp",
request_urllib(base + "v2.13.9/catch.hpp",
output_dir + "/catch2/catch.hpp")

# Adapt stuff from libadcc extension
Expand Down Expand Up @@ -357,7 +357,8 @@ def libadcc_extension():

if sys.platform == "darwin" and is_conda_build():
flags["extra_compile_args"] += ["-Wno-unused-command-line-argument",
"-Wno-undefined-var-template"]
"-Wno-undefined-var-template",
"-Wno-bitwise-instead-of-logical"]

platform_autoinstall = (
sys.platform.startswith("linux") or sys.platform.startswith("darwin")
Expand Down Expand Up @@ -534,7 +535,7 @@ def read_readme():
setup_requires=["pybind11 >= 2.6"],
install_requires=[
"opt_einsum >= 3.0",
"numpy >= 1.14",
"numpy >= 1.14, < 1.24", # problems with PE in pyscf for 1.24
"scipy >= 1.2",
"h5py >= 2.9",
"tqdm >= 4.30",
Expand Down

0 comments on commit 023ebea

Please sign in to comment.