From 5b1dd453f2746ca588b994ca1274f96ae9803013 Mon Sep 17 00:00:00 2001 From: lgiacome Date: Wed, 20 Nov 2024 18:47:41 +0100 Subject: [PATCH 1/2] add copyright header --- examples/000a_sps_tune_shift.py | 5 +++++ examples/000b_sps_tune_shift_multibunch.py | 5 +++++ examples/000c_sps_tune_shift_multibunch_mpi.py | 5 +++++ examples/001_many_resonators.py | 5 +++++ examples/001a_hllhc_instability_wake_table.py | 5 +++++ examples/001b_hllhc_instability_wake_table_multibunch.py | 5 +++++ examples/001c_hllhc_instability_wake_table_multibunch_mpi.py | 5 +++++ examples/002_wake_sum.py | 5 +++++ .../000_check_convolution_two_bunches.py | 5 +++++ .../001a_checks_on_slicer_and_compressed_profile_serial.py | 5 +++++ .../001b_checks_on_slicer_and_compressed_profile_mpi.py | 5 +++++ .../003a_resonator_impedance_check_transverse.py | 5 +++++ .../003b_resonator_impedance_check_longitudinal.py | 5 +++++ .../003c_thickwall_impedance_check_transverse.py | 5 +++++ .../003d_thickwall_impedance_check_longitudinal.py | 5 +++++ .../003e_table_impedance_check_transverse.py | 5 +++++ .../003f_table_impedance_check_longitudinal.py | 5 +++++ .../000_lhc_run3_instability_vs_pyheadtail.py | 5 +++++ .../instability_vs_pyheadtail/001_lhc_run3_time_realistic.py | 5 +++++ .../000b_hllhc_check_kick_table_dipolar.py | 5 +++++ .../000c_hllhc_check_kick_table_quadrupolar.py | 5 +++++ .../000d_hllhc_check_kick_table_longitudinal.py | 5 +++++ .../000e_check_kick_resonator_dipolar.py | 5 +++++ .../000f_check_kick_resonator_quadrupolar.py | 5 +++++ .../000g_check_kick_resonator_longitudinal.py | 5 +++++ .../001a_tune_shift_from_transverse_wakes.py | 5 +++++ .../001b_tune_shift_from_longitudinal_wakes.py | 5 +++++ pywit/__init__.py | 5 +++++ pywit/_generate_modules.py | 5 +++++ pywit/component.py | 5 +++++ pywit/devices.py | 5 +++++ pywit/element.py | 5 +++++ pywit/elements_group.py | 5 +++++ pywit/interface.py | 5 +++++ pywit/landau_damping.py | 5 +++++ pywit/materials.py | 5 +++++ pywit/model.py | 5 +++++ pywit/parameters.py | 5 +++++ pywit/plot.py | 5 +++++ pywit/sacherer_formula.py | 5 +++++ pywit/utilities.py | 5 +++++ pywit/utils.py | 5 +++++ setup.py | 5 +++++ .../generate_headtail_table_only_dip_quad.py | 5 +++++ tests/test_collective_monitor.py | 5 +++++ tests/test_common.py | 5 +++++ tests/test_component.py | 5 +++++ tests/test_config_pipeline_for_wakes.py | 5 +++++ tests/test_devices.py | 5 +++++ tests/test_element.py | 5 +++++ tests/test_instability_vs_pyht.py | 5 +++++ tests/test_interface.py | 5 +++++ tests/test_landau_damping.py | 5 +++++ tests/test_materials.py | 5 +++++ tests/test_sacherer.py | 5 +++++ tests/test_transverse_damper.py | 5 +++++ tests/test_utilities.py | 5 +++++ tests/test_utils.py | 5 +++++ tests/test_xwakes_headtail_table_read.py | 5 +++++ tests/test_xwakes_impedances_vs_analytic.py | 5 +++++ tests/test_xwakes_kick_vs_pyheadtail.py | 5 +++++ tests/test_xwakes_tune_shift.py | 5 +++++ tests/test_xwakes_wake_kicks.py | 5 +++++ tests/test_yokoya.py | 5 +++++ tests_mpi/test_wakefield_mpi.py | 5 +++++ xwakes/__init__.py | 5 +++++ xwakes/_version.py | 5 +++++ xwakes/basewake.py | 5 +++++ xwakes/beam_elements/__init__.py | 5 +++++ xwakes/beam_elements/collective_monitor.py | 5 +++++ xwakes/beam_elements/transverse_damper.py | 5 +++++ xwakes/config_pipeline_for_wakes.py | 5 +++++ xwakes/general.py | 5 +++++ xwakes/init_pywit_directory.py | 5 +++++ xwakes/read_headtail_table.py | 5 +++++ xwakes/resonator.py | 5 +++++ xwakes/thick_resistive_wall.py | 5 +++++ xwakes/wakefield_from_table.py | 5 +++++ xwakes/wit/__init__.py | 5 +++++ xwakes/wit/component.py | 5 +++++ xwakes/wit/devices.py | 5 +++++ xwakes/wit/element.py | 5 +++++ xwakes/wit/elements_group.py | 5 +++++ xwakes/wit/interface.py | 5 +++++ xwakes/wit/interface_dataclasses.py | 5 +++++ xwakes/wit/landau_damping.py | 5 +++++ xwakes/wit/materials.py | 5 +++++ xwakes/wit/model.py | 5 +++++ xwakes/wit/parameters.py | 5 +++++ xwakes/wit/plot.py | 5 +++++ xwakes/wit/sacherer_formula.py | 5 +++++ xwakes/wit/utilities.py | 5 +++++ xwakes/wit/utils.py | 5 +++++ xwakes/yokoya.py | 5 +++++ 94 files changed, 470 insertions(+) diff --git a/examples/000a_sps_tune_shift.py b/examples/000a_sps_tune_shift.py index c91bba67..e5d381fa 100644 --- a/examples/000a_sps_tune_shift.py +++ b/examples/000a_sps_tune_shift.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import matplotlib.pyplot as plt import numpy as np import pathlib diff --git a/examples/000b_sps_tune_shift_multibunch.py b/examples/000b_sps_tune_shift_multibunch.py index e1784189..27ca9c6f 100644 --- a/examples/000b_sps_tune_shift_multibunch.py +++ b/examples/000b_sps_tune_shift_multibunch.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import matplotlib.pyplot as plt import numpy as np import pathlib diff --git a/examples/000c_sps_tune_shift_multibunch_mpi.py b/examples/000c_sps_tune_shift_multibunch_mpi.py index e455c81d..3df1c558 100644 --- a/examples/000c_sps_tune_shift_multibunch_mpi.py +++ b/examples/000c_sps_tune_shift_multibunch_mpi.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + # mpirun -n 2 python 000c_sps_tune_shift_multibunch_mpi.py import numpy as np import pathlib diff --git a/examples/001_many_resonators.py b/examples/001_many_resonators.py index 873e60cb..02b2fe8e 100644 --- a/examples/001_many_resonators.py +++ b/examples/001_many_resonators.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xwakes as xw diff --git a/examples/001a_hllhc_instability_wake_table.py b/examples/001a_hllhc_instability_wake_table.py index a7c26d73..1d47f97c 100644 --- a/examples/001a_hllhc_instability_wake_table.py +++ b/examples/001a_hllhc_instability_wake_table.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import matplotlib.pyplot as plt from scipy.signal import hilbert diff --git a/examples/001b_hllhc_instability_wake_table_multibunch.py b/examples/001b_hllhc_instability_wake_table_multibunch.py index 060c4bf9..36b1c1c7 100644 --- a/examples/001b_hllhc_instability_wake_table_multibunch.py +++ b/examples/001b_hllhc_instability_wake_table_multibunch.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xtrack as xt import xpart as xp import xfields as xf diff --git a/examples/001c_hllhc_instability_wake_table_multibunch_mpi.py b/examples/001c_hllhc_instability_wake_table_multibunch_mpi.py index ae7b8da8..81f964fe 100644 --- a/examples/001c_hllhc_instability_wake_table_multibunch_mpi.py +++ b/examples/001c_hllhc_instability_wake_table_multibunch_mpi.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + # Run with: mpiexec -n 2 python 001c_hllhc_instability_wake_table_multibunch_mpi.py diff --git a/examples/002_wake_sum.py b/examples/002_wake_sum.py index 3fd2b7f9..a1945cb5 100644 --- a/examples/002_wake_sum.py +++ b/examples/002_wake_sum.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw diff --git a/examples/convolution_multibunch/000_check_convolution_two_bunches.py b/examples/convolution_multibunch/000_check_convolution_two_bunches.py index ea8c0c3e..0ff8d73f 100644 --- a/examples/convolution_multibunch/000_check_convolution_two_bunches.py +++ b/examples/convolution_multibunch/000_check_convolution_two_bunches.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xtrack as xt import xpart as xp import xwakes as xw diff --git a/examples/convolution_multibunch/001a_checks_on_slicer_and_compressed_profile_serial.py b/examples/convolution_multibunch/001a_checks_on_slicer_and_compressed_profile_serial.py index 047b026c..7415abae 100644 --- a/examples/convolution_multibunch/001a_checks_on_slicer_and_compressed_profile_serial.py +++ b/examples/convolution_multibunch/001a_checks_on_slicer_and_compressed_profile_serial.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xfields as xf import xtrack as xt import numpy as np diff --git a/examples/convolution_multibunch/001b_checks_on_slicer_and_compressed_profile_mpi.py b/examples/convolution_multibunch/001b_checks_on_slicer_and_compressed_profile_mpi.py index 2b7084f7..9c664dcb 100644 --- a/examples/convolution_multibunch/001b_checks_on_slicer_and_compressed_profile_mpi.py +++ b/examples/convolution_multibunch/001b_checks_on_slicer_and_compressed_profile_mpi.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + # mpiexec -n 3 xterm -e ipython # mpiexec -n 3 /Applications/iTerm.app/Contents/MacOS/iTerm2 diff --git a/examples/impedance_vs_analytic/003a_resonator_impedance_check_transverse.py b/examples/impedance_vs_analytic/003a_resonator_impedance_check_transverse.py index 9c19dd9e..ead5c826 100644 --- a/examples/impedance_vs_analytic/003a_resonator_impedance_check_transverse.py +++ b/examples/impedance_vs_analytic/003a_resonator_impedance_check_transverse.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw import xobjects as xo diff --git a/examples/impedance_vs_analytic/003b_resonator_impedance_check_longitudinal.py b/examples/impedance_vs_analytic/003b_resonator_impedance_check_longitudinal.py index ad600628..b64e857e 100644 --- a/examples/impedance_vs_analytic/003b_resonator_impedance_check_longitudinal.py +++ b/examples/impedance_vs_analytic/003b_resonator_impedance_check_longitudinal.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw import xobjects as xo diff --git a/examples/impedance_vs_analytic/003c_thickwall_impedance_check_transverse.py b/examples/impedance_vs_analytic/003c_thickwall_impedance_check_transverse.py index 3b8cf653..12908513 100644 --- a/examples/impedance_vs_analytic/003c_thickwall_impedance_check_transverse.py +++ b/examples/impedance_vs_analytic/003c_thickwall_impedance_check_transverse.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw import xobjects as xo diff --git a/examples/impedance_vs_analytic/003d_thickwall_impedance_check_longitudinal.py b/examples/impedance_vs_analytic/003d_thickwall_impedance_check_longitudinal.py index 9195d930..a948d219 100644 --- a/examples/impedance_vs_analytic/003d_thickwall_impedance_check_longitudinal.py +++ b/examples/impedance_vs_analytic/003d_thickwall_impedance_check_longitudinal.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw import xobjects as xo diff --git a/examples/impedance_vs_analytic/003e_table_impedance_check_transverse.py b/examples/impedance_vs_analytic/003e_table_impedance_check_transverse.py index 5366d1bc..ff211dad 100644 --- a/examples/impedance_vs_analytic/003e_table_impedance_check_transverse.py +++ b/examples/impedance_vs_analytic/003e_table_impedance_check_transverse.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pandas as pd import xwakes as xw diff --git a/examples/impedance_vs_analytic/003f_table_impedance_check_longitudinal.py b/examples/impedance_vs_analytic/003f_table_impedance_check_longitudinal.py index 8ef77874..0a0e4b45 100644 --- a/examples/impedance_vs_analytic/003f_table_impedance_check_longitudinal.py +++ b/examples/impedance_vs_analytic/003f_table_impedance_check_longitudinal.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pandas as pd import xwakes as xw diff --git a/examples/instability_vs_pyheadtail/000_lhc_run3_instability_vs_pyheadtail.py b/examples/instability_vs_pyheadtail/000_lhc_run3_instability_vs_pyheadtail.py index 96d3ed7e..438cdc19 100644 --- a/examples/instability_vs_pyheadtail/000_lhc_run3_instability_vs_pyheadtail.py +++ b/examples/instability_vs_pyheadtail/000_lhc_run3_instability_vs_pyheadtail.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pathlib import xobjects as xo diff --git a/examples/instability_vs_pyheadtail/001_lhc_run3_time_realistic.py b/examples/instability_vs_pyheadtail/001_lhc_run3_time_realistic.py index 5ca8f4a2..2e5eb9a6 100644 --- a/examples/instability_vs_pyheadtail/001_lhc_run3_time_realistic.py +++ b/examples/instability_vs_pyheadtail/001_lhc_run3_time_realistic.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pathlib import xobjects as xo diff --git a/examples/kick_against_pyheadtail/000b_hllhc_check_kick_table_dipolar.py b/examples/kick_against_pyheadtail/000b_hllhc_check_kick_table_dipolar.py index 91a674b8..70bad793 100644 --- a/examples/kick_against_pyheadtail/000b_hllhc_check_kick_table_dipolar.py +++ b/examples/kick_against_pyheadtail/000b_hllhc_check_kick_table_dipolar.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pandas as pd diff --git a/examples/kick_against_pyheadtail/000c_hllhc_check_kick_table_quadrupolar.py b/examples/kick_against_pyheadtail/000c_hllhc_check_kick_table_quadrupolar.py index 0f1a190c..adce114d 100644 --- a/examples/kick_against_pyheadtail/000c_hllhc_check_kick_table_quadrupolar.py +++ b/examples/kick_against_pyheadtail/000c_hllhc_check_kick_table_quadrupolar.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw diff --git a/examples/kick_against_pyheadtail/000d_hllhc_check_kick_table_longitudinal.py b/examples/kick_against_pyheadtail/000d_hllhc_check_kick_table_longitudinal.py index b1250d8d..f9eddf4a 100644 --- a/examples/kick_against_pyheadtail/000d_hllhc_check_kick_table_longitudinal.py +++ b/examples/kick_against_pyheadtail/000d_hllhc_check_kick_table_longitudinal.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xwakes as xw diff --git a/examples/kick_against_pyheadtail/000e_check_kick_resonator_dipolar.py b/examples/kick_against_pyheadtail/000e_check_kick_resonator_dipolar.py index ed02c5c2..0e700482 100644 --- a/examples/kick_against_pyheadtail/000e_check_kick_resonator_dipolar.py +++ b/examples/kick_against_pyheadtail/000e_check_kick_resonator_dipolar.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pandas as pd diff --git a/examples/kick_against_pyheadtail/000f_check_kick_resonator_quadrupolar.py b/examples/kick_against_pyheadtail/000f_check_kick_resonator_quadrupolar.py index d37fcab7..9bd9ca1c 100644 --- a/examples/kick_against_pyheadtail/000f_check_kick_resonator_quadrupolar.py +++ b/examples/kick_against_pyheadtail/000f_check_kick_resonator_quadrupolar.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pandas as pd diff --git a/examples/kick_against_pyheadtail/000g_check_kick_resonator_longitudinal.py b/examples/kick_against_pyheadtail/000g_check_kick_resonator_longitudinal.py index 614f5f42..5baedd98 100644 --- a/examples/kick_against_pyheadtail/000g_check_kick_resonator_longitudinal.py +++ b/examples/kick_against_pyheadtail/000g_check_kick_resonator_longitudinal.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pandas as pd diff --git a/examples/tune_shift_and_instability/001a_tune_shift_from_transverse_wakes.py b/examples/tune_shift_and_instability/001a_tune_shift_from_transverse_wakes.py index ccdc0d9f..1f7385f8 100644 --- a/examples/tune_shift_and_instability/001a_tune_shift_from_transverse_wakes.py +++ b/examples/tune_shift_and_instability/001a_tune_shift_from_transverse_wakes.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pandas as pd from scipy.constants import c as clight diff --git a/examples/tune_shift_and_instability/001b_tune_shift_from_longitudinal_wakes.py b/examples/tune_shift_and_instability/001b_tune_shift_from_longitudinal_wakes.py index f9d113bd..6eef1cdf 100644 --- a/examples/tune_shift_and_instability/001b_tune_shift_from_longitudinal_wakes.py +++ b/examples/tune_shift_and_instability/001b_tune_shift_from_longitudinal_wakes.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pandas as pd import numpy as np from scipy.constants import c as clight diff --git a/pywit/__init__.py b/pywit/__init__.py index 8262aed3..476f411d 100644 --- a/pywit/__init__.py +++ b/pywit/__init__.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit import * \ No newline at end of file diff --git a/pywit/_generate_modules.py b/pywit/_generate_modules.py index 4c095198..a807baf1 100644 --- a/pywit/_generate_modules.py +++ b/pywit/_generate_modules.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + ''' generate files to mirror in pywit the modules from xwakes.wit ''' diff --git a/pywit/component.py b/pywit/component.py index 494ae52f..a674ad5c 100644 --- a/pywit/component.py +++ b/pywit/component.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.component import * diff --git a/pywit/devices.py b/pywit/devices.py index 81f8db52..17e85cde 100644 --- a/pywit/devices.py +++ b/pywit/devices.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.devices import * diff --git a/pywit/element.py b/pywit/element.py index e9a6c3d9..42c8ade5 100644 --- a/pywit/element.py +++ b/pywit/element.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.element import * diff --git a/pywit/elements_group.py b/pywit/elements_group.py index 1a16666d..84f5a87d 100644 --- a/pywit/elements_group.py +++ b/pywit/elements_group.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.elements_group import * diff --git a/pywit/interface.py b/pywit/interface.py index ec0bb6ce..08dc0ede 100644 --- a/pywit/interface.py +++ b/pywit/interface.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.interface import * diff --git a/pywit/landau_damping.py b/pywit/landau_damping.py index 39882ab7..36ef869c 100644 --- a/pywit/landau_damping.py +++ b/pywit/landau_damping.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.landau_damping import * diff --git a/pywit/materials.py b/pywit/materials.py index 0441f038..8b79e9f7 100644 --- a/pywit/materials.py +++ b/pywit/materials.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.materials import * diff --git a/pywit/model.py b/pywit/model.py index 08d74639..4c92c734 100644 --- a/pywit/model.py +++ b/pywit/model.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.model import * diff --git a/pywit/parameters.py b/pywit/parameters.py index 2e3c6dc4..728839df 100644 --- a/pywit/parameters.py +++ b/pywit/parameters.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.parameters import * diff --git a/pywit/plot.py b/pywit/plot.py index bc606669..d6a43585 100644 --- a/pywit/plot.py +++ b/pywit/plot.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.plot import * diff --git a/pywit/sacherer_formula.py b/pywit/sacherer_formula.py index de7b4779..ededeaef 100644 --- a/pywit/sacherer_formula.py +++ b/pywit/sacherer_formula.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.sacherer_formula import * diff --git a/pywit/utilities.py b/pywit/utilities.py index f61c1064..d6906ca0 100644 --- a/pywit/utilities.py +++ b/pywit/utilities.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.utilities import * diff --git a/pywit/utils.py b/pywit/utils.py index 10834455..20e785e2 100644 --- a/pywit/utils.py +++ b/pywit/utils.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xwakes.wit.utils import * diff --git a/setup.py b/setup.py index fbbf661e..40a9b861 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from setuptools import setup, find_packages, Extension from pathlib import Path diff --git a/test_data/headtail_format_table_hllhc/generate_headtail_table_only_dip_quad.py b/test_data/headtail_format_table_hllhc/generate_headtail_table_only_dip_quad.py index f645c1f1..6e2452a0 100644 --- a/test_data/headtail_format_table_hllhc/generate_headtail_table_only_dip_quad.py +++ b/test_data/headtail_format_table_hllhc/generate_headtail_table_only_dip_quad.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + """ This file generates a headtail formatted table with dipolar and quadrupolar wakefields only diff --git a/tests/test_collective_monitor.py b/tests/test_collective_monitor.py index 562cc78d..48a9e6a1 100644 --- a/tests/test_collective_monitor.py +++ b/tests/test_collective_monitor.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xwakes as xw import xtrack as xt from xobjects.test_helpers import for_all_test_contexts diff --git a/tests/test_common.py b/tests/test_common.py index 45df13a7..65b23625 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from math import sqrt, log from numpy import vectorize, sin, cos diff --git a/tests/test_component.py b/tests/test_component.py index 0963e72e..09841930 100644 --- a/tests/test_component.py +++ b/tests/test_component.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pywit.component import (Component, mix_fine_and_rough_sampling) from test_common import functions diff --git a/tests/test_config_pipeline_for_wakes.py b/tests/test_config_pipeline_for_wakes.py index 526f9709..92c69e64 100644 --- a/tests/test_config_pipeline_for_wakes.py +++ b/tests/test_config_pipeline_for_wakes.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xtrack as xt import xwakes as xw from xobjects.test_helpers import for_all_test_contexts diff --git a/tests/test_devices.py b/tests/test_devices.py index 1cf7afbc..77ca442e 100644 --- a/tests/test_devices.py +++ b/tests/test_devices.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pywit.devices import create_tesla_cavity_component, shunt_impedance_flat_taper_stupakov_formula import numpy as np diff --git a/tests/test_element.py b/tests/test_element.py index e81de60b..1c492157 100644 --- a/tests/test_element.py +++ b/tests/test_element.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pywit.element import Element, Component from test_common import functions from pywit.parameters import * diff --git a/tests/test_instability_vs_pyht.py b/tests/test_instability_vs_pyht.py index 10c605df..e97d57ca 100644 --- a/tests/test_instability_vs_pyht.py +++ b/tests/test_instability_vs_pyht.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pathlib import xobjects as xo diff --git a/tests/test_interface.py b/tests/test_interface.py index 2c18ea14..deb629ad 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import os import pytest diff --git a/tests/test_landau_damping.py b/tests/test_landau_damping.py index cbe82b48..b4472307 100644 --- a/tests/test_landau_damping.py +++ b/tests/test_landau_damping.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pytest import numpy as np diff --git a/tests/test_materials.py b/tests/test_materials.py index 967f445c..e5592955 100644 --- a/tests/test_materials.py +++ b/tests/test_materials.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pywit import materials from numpy import testing diff --git a/tests/test_sacherer.py b/tests/test_sacherer.py index 4f6612ab..27ae0616 100644 --- a/tests/test_sacherer.py +++ b/tests/test_sacherer.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np from scipy import constants as cst diff --git a/tests/test_transverse_damper.py b/tests/test_transverse_damper.py index f52c1455..3a506e43 100644 --- a/tests/test_transverse_damper.py +++ b/tests/test_transverse_damper.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np from scipy.constants import c from scipy.constants import physical_constants diff --git a/tests/test_utilities.py b/tests/test_utilities.py index 9efe2865..d1fa0584 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pywit.utilities import (create_resonator_component, create_resonator_element, create_many_resonators_element, create_resistive_wall_single_layer_approx_component, diff --git a/tests/test_utils.py b/tests/test_utils.py index 1600fd40..21bf4f3b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pywit.utils import round_sigfigs, unique_sigfigs from numpy import testing diff --git a/tests/test_xwakes_headtail_table_read.py b/tests/test_xwakes_headtail_table_read.py index 2d554435..faf16821 100644 --- a/tests/test_xwakes_headtail_table_read.py +++ b/tests/test_xwakes_headtail_table_read.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xobjects as xo import xwakes as xw diff --git a/tests/test_xwakes_impedances_vs_analytic.py b/tests/test_xwakes_impedances_vs_analytic.py index fb84da19..cdb2ad04 100644 --- a/tests/test_xwakes_impedances_vs_analytic.py +++ b/tests/test_xwakes_impedances_vs_analytic.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pytest import pathlib diff --git a/tests/test_xwakes_kick_vs_pyheadtail.py b/tests/test_xwakes_kick_vs_pyheadtail.py index 989c064c..85e01933 100644 --- a/tests/test_xwakes_kick_vs_pyheadtail.py +++ b/tests/test_xwakes_kick_vs_pyheadtail.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pathlib import numpy as np diff --git a/tests/test_xwakes_tune_shift.py b/tests/test_xwakes_tune_shift.py index be884238..f15a65e4 100644 --- a/tests/test_xwakes_tune_shift.py +++ b/tests/test_xwakes_tune_shift.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pandas as pd import numpy as np import pytest diff --git a/tests/test_xwakes_wake_kicks.py b/tests/test_xwakes_wake_kicks.py index 3aa5f30a..9c47d26c 100644 --- a/tests/test_xwakes_wake_kicks.py +++ b/tests/test_xwakes_wake_kicks.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import xtrack as xt import xpart as xp import xwakes as xw diff --git a/tests/test_yokoya.py b/tests/test_yokoya.py index 6cb9599d..fc2a8609 100644 --- a/tests/test_yokoya.py +++ b/tests/test_yokoya.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import pathlib diff --git a/tests_mpi/test_wakefield_mpi.py b/tests_mpi/test_wakefield_mpi.py index a1f88a73..764e039b 100644 --- a/tests_mpi/test_wakefield_mpi.py +++ b/tests_mpi/test_wakefield_mpi.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + # mpiexec -n 3 pytest test_wakefield_mpi.py import xfields as xf diff --git a/xwakes/__init__.py b/xwakes/__init__.py index 2df986d6..afb7cde1 100644 --- a/xwakes/__init__.py +++ b/xwakes/__init__.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from ._version import __version__ from .general import _pkg_root diff --git a/xwakes/_version.py b/xwakes/_version.py index b794fd40..7054f92e 100644 --- a/xwakes/_version.py +++ b/xwakes/_version.py @@ -1 +1,6 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + __version__ = '0.1.0' diff --git a/xwakes/basewake.py b/xwakes/basewake.py index d8f9edbe..f2a5f1be 100644 --- a/xwakes/basewake.py +++ b/xwakes/basewake.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from typing import Tuple import xpart as xp import numpy as np diff --git a/xwakes/beam_elements/__init__.py b/xwakes/beam_elements/__init__.py index e69de29b..8b35637f 100644 --- a/xwakes/beam_elements/__init__.py +++ b/xwakes/beam_elements/__init__.py @@ -0,0 +1,5 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + diff --git a/xwakes/beam_elements/collective_monitor.py b/xwakes/beam_elements/collective_monitor.py index 131c948a..b9456744 100644 --- a/xwakes/beam_elements/collective_monitor.py +++ b/xwakes/beam_elements/collective_monitor.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np from xfields.beam_elements.element_with_slicer import ElementWithSlicer diff --git a/xwakes/beam_elements/transverse_damper.py b/xwakes/beam_elements/transverse_damper.py index 83bc8623..476bc710 100644 --- a/xwakes/beam_elements/transverse_damper.py +++ b/xwakes/beam_elements/transverse_damper.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import xpart as xp diff --git a/xwakes/config_pipeline_for_wakes.py b/xwakes/config_pipeline_for_wakes.py index 08eab3e5..48c32fac 100644 --- a/xwakes/config_pipeline_for_wakes.py +++ b/xwakes/config_pipeline_for_wakes.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from xtrack.pipeline.manager import PipelineManager from xtrack.pipeline.multitracker import PipelineBranch, PipelineMultiTracker diff --git a/xwakes/general.py b/xwakes/general.py index fe3a3a1e..a7ec40b1 100644 --- a/xwakes/general.py +++ b/xwakes/general.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from pathlib import Path _pkg_root = Path(__file__).parent.absolute() diff --git a/xwakes/init_pywit_directory.py b/xwakes/init_pywit_directory.py index 1b02a8aa..ce5c8bf2 100644 --- a/xwakes/init_pywit_directory.py +++ b/xwakes/init_pywit_directory.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pathlib import pickle import os diff --git a/xwakes/read_headtail_table.py b/xwakes/read_headtail_table.py index 42c8d8d3..31e4bff8 100644 --- a/xwakes/read_headtail_table.py +++ b/xwakes/read_headtail_table.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pandas as pd import numpy as np diff --git a/xwakes/resonator.py b/xwakes/resonator.py index abff5a1f..01b015f5 100644 --- a/xwakes/resonator.py +++ b/xwakes/resonator.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from typing import Tuple from .basewake import BaseWake, _handle_kind diff --git a/xwakes/thick_resistive_wall.py b/xwakes/thick_resistive_wall.py index ee64e4f0..307cd30a 100644 --- a/xwakes/thick_resistive_wall.py +++ b/xwakes/thick_resistive_wall.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from typing import Tuple from .basewake import BaseWake, _handle_kind diff --git a/xwakes/wakefield_from_table.py b/xwakes/wakefield_from_table.py index 999b1e57..7b68e7aa 100644 --- a/xwakes/wakefield_from_table.py +++ b/xwakes/wakefield_from_table.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import pandas as pd from .basewake import BaseWake from .wit import ComponentFromArrays diff --git a/xwakes/wit/__init__.py b/xwakes/wit/__init__.py index 0b44708d..3e3212c0 100644 --- a/xwakes/wit/__init__.py +++ b/xwakes/wit/__init__.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from . import component from . import devices from . import element diff --git a/xwakes/wit/component.py b/xwakes/wit/component.py index 4686c8f6..e0e2de4f 100644 --- a/xwakes/wit/component.py +++ b/xwakes/wit/component.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from __future__ import annotations from .interface_dataclasses import Layer, FlatIW2DInput, RoundIW2DInput diff --git a/xwakes/wit/devices.py b/xwakes/wit/devices.py index 8d30bc8e..8125ca90 100644 --- a/xwakes/wit/devices.py +++ b/xwakes/wit/devices.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from typing import Tuple,Sequence from .component import Component from .element import Element diff --git a/xwakes/wit/element.py b/xwakes/wit/element.py index b2f82900..f3f96290 100644 --- a/xwakes/wit/element.py +++ b/xwakes/wit/element.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from __future__ import annotations from .component import Component, Union, KIND_DEFINITIONS diff --git a/xwakes/wit/elements_group.py b/xwakes/wit/elements_group.py index 872e340b..7c2e3687 100644 --- a/xwakes/wit/elements_group.py +++ b/xwakes/wit/elements_group.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from __future__ import annotations import numpy as np diff --git a/xwakes/wit/interface.py b/xwakes/wit/interface.py index b9ceafcb..527500b9 100644 --- a/xwakes/wit/interface.py +++ b/xwakes/wit/interface.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import os from .component import Component diff --git a/xwakes/wit/interface_dataclasses.py b/xwakes/wit/interface_dataclasses.py index eb0a229e..124f8b42 100644 --- a/xwakes/wit/interface_dataclasses.py +++ b/xwakes/wit/interface_dataclasses.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from dataclasses import dataclass from typing import Tuple, Optional import numpy as np diff --git a/xwakes/wit/landau_damping.py b/xwakes/wit/landau_damping.py index 97127573..104aedc1 100644 --- a/xwakes/wit/landau_damping.py +++ b/xwakes/wit/landau_damping.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np from scipy.special import exp1 from scipy.optimize import newton diff --git a/xwakes/wit/materials.py b/xwakes/wit/materials.py index 90ad952c..f832fcda 100644 --- a/xwakes/wit/materials.py +++ b/xwakes/wit/materials.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from .utils import round_sigfigs from pathlib import Path diff --git a/xwakes/wit/model.py b/xwakes/wit/model.py index 6e029e37..0ad444a1 100644 --- a/xwakes/wit/model.py +++ b/xwakes/wit/model.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from .element import Element from typing import List, Optional, Tuple diff --git a/xwakes/wit/parameters.py b/xwakes/wit/parameters.py index 8dfe3b8f..8ab6a4f3 100644 --- a/xwakes/wit/parameters.py +++ b/xwakes/wit/parameters.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + REL_TOL = 1e-8 ABS_TOL = 1e-8 PRECISION_FACTOR = 100. diff --git a/xwakes/wit/plot.py b/xwakes/wit/plot.py index ecdbbdcc..e3beda25 100644 --- a/xwakes/wit/plot.py +++ b/xwakes/wit/plot.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from .component import Component from .element import Element from .model import Model diff --git a/xwakes/wit/sacherer_formula.py b/xwakes/wit/sacherer_formula.py index 88e8eb99..197a1ea3 100644 --- a/xwakes/wit/sacherer_formula.py +++ b/xwakes/wit/sacherer_formula.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + import numpy as np import sys diff --git a/xwakes/wit/utilities.py b/xwakes/wit/utilities.py index d299a940..f9a8009c 100644 --- a/xwakes/wit/utilities.py +++ b/xwakes/wit/utilities.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from .component import (Component, ComponentResonator, ComponentClassicThickWall, ComponentSingleLayerResistiveWall, diff --git a/xwakes/wit/utils.py b/xwakes/wit/utils.py index cff25e4b..b6cd459a 100644 --- a/xwakes/wit/utils.py +++ b/xwakes/wit/utils.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from typing import Sequence, Union import numpy as np diff --git a/xwakes/yokoya.py b/xwakes/yokoya.py index 3745c7ab..0dce230b 100644 --- a/xwakes/yokoya.py +++ b/xwakes/yokoya.py @@ -1,3 +1,8 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + from typing import Tuple, List import numpy as np From ea83516d060b30860dd471ca8be61861687386b6 Mon Sep 17 00:00:00 2001 From: lgiacome Date: Wed, 20 Nov 2024 19:43:05 +0100 Subject: [PATCH 2/2] add script for copyright --- update_cprght_statement.py | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 update_cprght_statement.py diff --git a/update_cprght_statement.py b/update_cprght_statement.py new file mode 100644 index 00000000..d5f2cd9d --- /dev/null +++ b/update_cprght_statement.py @@ -0,0 +1,48 @@ +# copyright ############################### # +# This file is part of the Xwakes Package. # +# Copyright (c) CERN, 2024. # +# ######################################### # + +import os + +copyright_statement = ( +"""copyright ############################### +This file is part of the Xwakes Package. +Copyright (c) CERN, 2024. +#########################################""") + +config = [ + {'extension': '.py', 'comment_char': '#'}, + {'extension': '.h', 'comment_char': '//'}, +] + +for cc in config: + extension = cc['extension'] + comment_char = cc['comment_char'] + + cpright_lines = [comment_char + ' ' + line + " " + comment_char + '\n' + for line in copyright_statement.splitlines() + ] + ['\n'] + + for root, dirs, files in os.walk("./"): + for fname in files: + if fname.endswith(extension): + file = os.path.join(root, fname) + print(file) + with open(file, 'r') as fid: + lines = fid.readlines() + # Remove copyright statement if present + if (len(lines) > 0 and + lines[0].startswith(comment_char + ' ' + 'copyright ##')): + for ill, ll in enumerate(lines): + assert ll.startswith(comment_char) + if ll.startswith(comment_char + ' ' + '########'): + end_cpright = ill + break + assert lines[end_cpright+1] == '\n' + lines = lines[end_cpright+2:] + + lines = cpright_lines + lines + + with open(file, 'w') as fid: + fid.writelines(lines)