diff --git a/qupulse/_program/_loop.py b/qupulse/_program/_loop.py
index e0a4e6c9..46795839 100644
--- a/qupulse/_program/_loop.py
+++ b/qupulse/_program/_loop.py
@@ -493,17 +493,27 @@ def to_waveform(program: Loop) -> Waveform:
 class _CompatibilityLevel(Enum):
     compatible = 0
     action_required = 1
-    incompatible = 2
+    incompatible_too_short = 2
+    incompatible_fraction = 3
+    incompatible_quantum = 4
 
 
 def _is_compatible(program: Loop, min_len: int, quantum: int, sample_rate: TimeType) -> _CompatibilityLevel:
+    """ check whether program loop is compatible with awg requirements
+        possible reasons for incompatibility:
+            program shorter than minimum length
+            program duration not an integer
+            program duration not a multiple of quantum """
     program_duration_in_samples = program.duration * sample_rate
 
     if program_duration_in_samples.denominator != 1:
-        return _CompatibilityLevel.incompatible
+        return _CompatibilityLevel.incompatible_fraction
 
-    if program_duration_in_samples < min_len or program_duration_in_samples % quantum > 0:
-        return _CompatibilityLevel.incompatible
+    if program_duration_in_samples < min_len:
+        return _CompatibilityLevel.incompatible_too_short
+
+    if program_duration_in_samples % quantum > 0:
+        return _CompatibilityLevel.incompatible_quantum
 
     if program.is_leaf():
         waveform_duration_in_samples = program.body_duration * sample_rate
@@ -520,18 +530,19 @@ def _is_compatible(program: Loop, min_len: int, quantum: int, sample_rate: TimeT
 
 
 def _make_compatible(program: Loop, min_len: int, quantum: int, sample_rate: TimeType) -> None:
-
     if program.is_leaf():
         program.waveform = to_waveform(program.copy_tree_structure())
         program.repetition_count = 1
-
     else:
-        comp_levels = np.array([_is_compatible(cast(Loop, sub_program), min_len, quantum, sample_rate)
-                                for sub_program in program])
-        incompatible = comp_levels == _CompatibilityLevel.incompatible
-        if np.any(incompatible):
+        comp_levels = [_is_compatible(cast(Loop, sub_program), min_len, quantum, sample_rate)
+                       for sub_program in program]
+        incompatible = any(comp_level in (_CompatibilityLevel.incompatible_fraction,
+                                          _CompatibilityLevel.incompatible_quantum,
+                                          _CompatibilityLevel.incompatible_too_short)
+                           for comp_level in comp_levels)
+        if incompatible:
             single_run = program.duration * sample_rate / program.repetition_count
-            if is_integer(single_run / quantum) and single_run >= min_len:
+            if (single_run / quantum).denominator == 1 and single_run >= min_len:
                 new_repetition_count = program.repetition_count
                 program.repetition_count = 1
             else:
@@ -547,12 +558,19 @@ def _make_compatible(program: Loop, min_len: int, quantum: int, sample_rate: Tim
 
 
 def make_compatible(program: Loop, minimal_waveform_length: int, waveform_quantum: int, sample_rate: TimeType):
+    """ check program for compatibility to AWG requirements, make it compatible if necessary and  possible"""
+
     comp_level = _is_compatible(program,
                                 min_len=minimal_waveform_length,
                                 quantum=waveform_quantum,
                                 sample_rate=sample_rate)
-    if comp_level == _CompatibilityLevel.incompatible:
-        raise ValueError('The program cannot be made compatible to restrictions')
+    if comp_level == _CompatibilityLevel.incompatible_fraction:
+        raise ValueError('The program duration in samples {} is not an integer'.format(program.duration * sample_rate))
+    if comp_level == _CompatibilityLevel.incompatible_too_short:
+        raise ValueError('The program is too short to be a valid waveform. \n program duration in samples: {} \n minimal length: {}'.format(program.duration * sample_rate, minimal_waveform_length))
+    if comp_level == _CompatibilityLevel.incompatible_quantum:
+        raise ValueError('The program duration in samples {} is not a multiple of quantum {}'.format(program.duration * sample_rate, waveform_quantum))
+
     elif comp_level == _CompatibilityLevel.action_required:
         _make_compatible(program,
                          min_len=minimal_waveform_length,
diff --git a/qupulse/hardware/awgs/tektronix.py b/qupulse/hardware/awgs/tektronix.py
index c99b6cdd..77a56d33 100644
--- a/qupulse/hardware/awgs/tektronix.py
+++ b/qupulse/hardware/awgs/tektronix.py
@@ -214,7 +214,7 @@ class TektronixProgram:
                                                                    offsets=self._offsets)
 
     def get_sequencing_elements(self) -> Sequence[tek_awg.SequenceEntry]:
-        """The entries are either of type TekAwh.Waveform or integers which signal an idle waveform of this length"""
+        """The entries are either of type TekAwg.Waveform or integers which signal an idle waveform of this length"""
         return self._sequencing_elements
 
     def get_waveforms(self) -> Sequence[Union[tek_awg.Waveform, int]]:

Improve make_compatible's handling of too short programs
Currently `qupulse.program._loop.make_compatible`  throws an error if the program is to short to be a valid waveform. `ValueError: The program cannot be made compatible to restrictions`
1. From the error message this is not obvious to the end user. This needs to be improved.
2. We can easily add optional automatic padding functionality

diff --git a/tests/_program/loop_tests.py b/tests/_program/loop_tests.py
index 7662e1d8..d016bb2b 100644
--- a/tests/_program/loop_tests.py
+++ b/tests/_program/loop_tests.py
@@ -542,13 +542,14 @@ class ProgramWaveformCompatibilityTest(unittest.TestCase):
         wf = DummyWaveform(duration=1.1)
 
         self.assertEqual(_is_compatible(Loop(waveform=wf), min_len=1, quantum=1, sample_rate=time_from_float(1.)),
-                         _CompatibilityLevel.incompatible)
+                         _CompatibilityLevel.incompatible_fraction)
 
         self.assertEqual(_is_compatible(Loop(waveform=wf, repetition_count=10), min_len=20, quantum=1, sample_rate=time_from_float(1.)),
-                         _CompatibilityLevel.incompatible)
+                         _CompatibilityLevel.incompatible_too_short)
 
         self.assertEqual(_is_compatible(Loop(waveform=wf, repetition_count=10), min_len=10, quantum=3, sample_rate=time_from_float(1.)),
-                         _CompatibilityLevel.incompatible)
+                         _CompatibilityLevel.incompatible_quantum)
+
 
     def test_is_compatible_leaf(self):
         self.assertEqual(_is_compatible(Loop(waveform=DummyWaveform(duration=1.1), repetition_count=10),
@@ -569,6 +570,29 @@ class ProgramWaveformCompatibilityTest(unittest.TestCase):
         self.assertEqual(_is_compatible(program, min_len=1, quantum=1, sample_rate=time_from_float(1.)),
                          _CompatibilityLevel.action_required)
 
+    def test_make_compatible_repetition_count(self):
+        wf1 = DummyWaveform(duration=1.5)
+        wf2 = DummyWaveform(duration=2.0)
+
+        program = Loop(children=[Loop(waveform=wf1, repetition_count=2),
+                                 Loop(waveform=wf2)])
+        duration = program.duration
+        _make_compatible(program, min_len=1, quantum=1, sample_rate=time_from_float(1.))
+        self.assertEqual(program.duration, duration)
+
+        wf2 = DummyWaveform(duration=2.5)
+        program = Loop(children=[Loop(waveform=wf1, repetition_count=3),
+                                 Loop(waveform=wf2)])
+        duration = program.duration
+        make_compatible(program, minimal_waveform_length=1, waveform_quantum=1, sample_rate=time_from_float(1.))
+        self.assertEqual(program.duration, duration)
+
+        program = Loop(children=[Loop(waveform=wf1, repetition_count=3),
+                                 Loop(waveform=wf2)], repetition_count=3)
+        duration = program.duration
+        _make_compatible(program, min_len=1, quantum=3, sample_rate=time_from_float(1.))
+        self.assertEqual(program.duration, duration)
+
     def test_make_compatible_partial_unroll(self):
         wf1 = DummyWaveform(duration=1.5)
         wf2 = DummyWaveform(duration=2.0)
@@ -630,8 +654,20 @@ class ProgramWaveformCompatibilityTest(unittest.TestCase):
         priv_kwargs = dict(min_len=5, quantum=10, sample_rate=time_from_float(1.))
 
         with mock.patch('qupulse._program._loop._is_compatible',
-                        return_value=_CompatibilityLevel.incompatible) as mocked:
-            with self.assertRaisesRegex(ValueError, 'cannot be made compatible'):
+                        return_value=_CompatibilityLevel.incompatible_too_short) as mocked:
+            with self.assertRaisesRegex(ValueError, 'too short'):
+                make_compatible(program, **pub_kwargs)
+            mocked.assert_called_once_with(program, **priv_kwargs)
+
+        with mock.patch('qupulse._program._loop._is_compatible',
+                        return_value=_CompatibilityLevel.incompatible_fraction) as mocked:
+            with self.assertRaisesRegex(ValueError, 'not an integer'):
+                make_compatible(program, **pub_kwargs)
+            mocked.assert_called_once_with(program, **priv_kwargs)
+
+        with mock.patch('qupulse._program._loop._is_compatible',
+                        return_value=_CompatibilityLevel.incompatible_quantum) as mocked:
+            with self.assertRaisesRegex(ValueError, 'not a multiple of quantum'):
                 make_compatible(program, **pub_kwargs)
             mocked.assert_called_once_with(program, **priv_kwargs)
 

pip3 install .[plotting,zurich-instruments,tektronix,Faster-fractions]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y libgmp-dev libmpfr-dev libmpc-dev
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
cached-property==1.5.2
certifi==2021.5.30
coverage==6.2
cycler==0.11.0
dataclasses==0.8
execnet==1.9.0
gmpy2==2.1.5
importlib-metadata==4.8.3
iniconfig==1.1.1
kiwisolver==1.3.1
matplotlib==3.3.4
mpmath==1.3.0
numpy==1.19.5
packaging==21.3
Pillow==8.4.0
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
python-dateutil==2.9.0.post0
PyVISA==1.11.3
qupulse @ file:///qupulse
six==1.17.0
sympy==1.9
tek-awg==0.2.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: qupulse
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - cached-property==1.5.2
      - coverage==6.2
      - cycler==0.11.0
      - dataclasses==0.8
      - execnet==1.9.0
      - gmpy2==2.1.5
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - kiwisolver==1.3.1
      - matplotlib==3.3.4
      - mpmath==1.3.0
      - numpy==1.19.5
      - packaging==21.3
      - pillow==8.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - python-dateutil==2.9.0.post0
      - pyvisa==1.11.3
      - qupulse==0.4
      - six==1.17.0
      - sympy==1.9
      - tek-awg==0.2.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/qupulse

tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_is_compatible_incompatible tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_make_compatible
tests/_program/loop_tests.py::LoopTests::test_cleanup tests/_program/loop_tests.py::LoopTests::test_cleanup_warnings tests/_program/loop_tests.py::LoopTests::test_compare_key tests/_program/loop_tests.py::LoopTests::test_depth tests/_program/loop_tests.py::LoopTests::test_flatten_and_balance tests/_program/loop_tests.py::LoopTests::test_flatten_and_balance_comparison_based tests/_program/loop_tests.py::LoopTests::test_is_balanced tests/_program/loop_tests.py::LoopTests::test_is_leaf tests/_program/loop_tests.py::LoopTests::test_remove_empty_loops tests/_program/loop_tests.py::LoopTests::test_repr tests/_program/loop_tests.py::LoopTests::test_unroll tests/_program/loop_tests.py::MultiChannelTests::test_empty_repj tests/_program/loop_tests.py::MultiChannelTests::test_init tests/_program/loop_tests.py::MultiChannelTests::test_init_from_loop tests/_program/loop_tests.py::MultiChannelTests::test_via_repr tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_is_compatible_leaf tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_is_compatible_node tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_make_compatible_complete_unroll tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_make_compatible_partial_unroll tests/_program/loop_tests.py::ProgramWaveformCompatibilityTest::test_make_compatible_repetition_count
qupulse/_program/_loop.py qupulse/hardware/awgs/tektronix.py
qupulse/_program/_loop.py qupulse/hardware/awgs/tektronix.py